Commit 85217178 authored by Robert Knight's avatar Robert Knight

Convert <help-link> and <help-panel> to components

parent f7f10dfd
...@@ -140,14 +140,14 @@ module.exports = angular.module('h', [ ...@@ -140,14 +140,14 @@ module.exports = angular.module('h', [
.component('annotationShareDialog', require('./directive/annotation-share-dialog')) .component('annotationShareDialog', require('./directive/annotation-share-dialog'))
.component('annotationThread', require('./directive/annotation-thread')) .component('annotationThread', require('./directive/annotation-thread'))
.component('dropdownMenuBtn', require('./directive/dropdown-menu-btn')) .component('dropdownMenuBtn', require('./directive/dropdown-menu-btn'))
.component('helpLink', require('./directive/help-link'))
.component('helpPanel', require('./directive/help-panel'))
.component('publishAnnotationBtn', require('./directive/publish-annotation-btn')) .component('publishAnnotationBtn', require('./directive/publish-annotation-btn'))
.directive('excerpt', require('./directive/excerpt').directive) .directive('excerpt', require('./directive/excerpt').directive)
.directive('formInput', require('./directive/form-input')) .directive('formInput', require('./directive/form-input'))
.directive('formValidate', require('./directive/form-validate')) .directive('formValidate', require('./directive/form-validate'))
.directive('groupList', require('./directive/group-list').directive) .directive('groupList', require('./directive/group-list').directive)
.directive('helpLink', require('./directive/help-link'))
.directive('helpPanel', require('./directive/help-panel'))
.directive('hAutofocus', require('./directive/h-autofocus')) .directive('hAutofocus', require('./directive/h-autofocus'))
.directive('hOnTouch', require('./directive/h-on-touch')) .directive('hOnTouch', require('./directive/h-on-touch'))
.directive('hTooltip', require('./directive/h-tooltip')) .directive('hTooltip', require('./directive/h-tooltip'))
......
'use strict'; 'use strict';
module.exports = function () { module.exports = {
return { controllerAs: 'vm',
bindToController: true, template: require('../templates/help_link.html'),
controllerAs: 'vm', controller: function () {},
restrict: 'E', scope: {
template: require('../templates/help_link.html'), version: '<',
controller: function () {}, userAgent: '<',
scope: { url: '<',
version: '<', documentFingerprint: '<',
userAgent: '<', auth: '<',
url: '<', dateTime: '<',
documentFingerprint: '<', },
auth: '<',
dateTime: '<',
},
};
}; };
...@@ -6,35 +6,31 @@ ...@@ -6,35 +6,31 @@
* @description Displays product version and environment info * @description Displays product version and environment info
*/ */
// @ngInject // @ngInject
module.exports = function () { module.exports = {
return { controllerAs: 'vm',
bindToController: true, // @ngInject
controllerAs: 'vm', controller: function ($scope, $window, annotationUI, serviceUrl) {
// @ngInject this.userAgent = $window.navigator.userAgent;
controller: function ($scope, $window, annotationUI, serviceUrl) { this.version = '__VERSION__'; // replaced by versionify
this.userAgent = $window.navigator.userAgent; this.dateTime = new Date();
this.version = '__VERSION__'; // replaced by versionify this.serviceUrl = serviceUrl;
this.dateTime = new Date();
this.serviceUrl = serviceUrl;
$scope.$watch( $scope.$watch(
function () { function () {
return annotationUI.frames(); return annotationUI.frames();
}, },
function (frames) { function (frames) {
if (frames.length === 0) { if (frames.length === 0) {
return; return;
} }
this.url = frames[0].uri; this.url = frames[0].uri;
this.documentFingerprint = frames[0].documentFingerprint; this.documentFingerprint = frames[0].documentFingerprint;
}.bind(this) }.bind(this)
); );
}, },
restrict: 'E', template: require('../templates/help_panel.html'),
template: require('../templates/help_panel.html'), bindings: {
scope: { auth: '<',
auth: '<', onClose: '&',
onClose: '&', },
},
};
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment