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', [
.component('annotationShareDialog', require('./directive/annotation-share-dialog'))
.component('annotationThread', require('./directive/annotation-thread'))
.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'))
.directive('excerpt', require('./directive/excerpt').directive)
.directive('formInput', require('./directive/form-input'))
.directive('formValidate', require('./directive/form-validate'))
.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('hOnTouch', require('./directive/h-on-touch'))
.directive('hTooltip', require('./directive/h-tooltip'))
......
'use strict';
module.exports = function () {
return {
bindToController: true,
controllerAs: 'vm',
restrict: 'E',
template: require('../templates/help_link.html'),
controller: function () {},
scope: {
version: '<',
userAgent: '<',
url: '<',
documentFingerprint: '<',
auth: '<',
dateTime: '<',
},
};
module.exports = {
controllerAs: 'vm',
template: require('../templates/help_link.html'),
controller: function () {},
scope: {
version: '<',
userAgent: '<',
url: '<',
documentFingerprint: '<',
auth: '<',
dateTime: '<',
},
};
......@@ -6,35 +6,31 @@
* @description Displays product version and environment info
*/
// @ngInject
module.exports = function () {
return {
bindToController: true,
controllerAs: 'vm',
// @ngInject
controller: function ($scope, $window, annotationUI, serviceUrl) {
this.userAgent = $window.navigator.userAgent;
this.version = '__VERSION__'; // replaced by versionify
this.dateTime = new Date();
this.serviceUrl = serviceUrl;
module.exports = {
controllerAs: 'vm',
// @ngInject
controller: function ($scope, $window, annotationUI, serviceUrl) {
this.userAgent = $window.navigator.userAgent;
this.version = '__VERSION__'; // replaced by versionify
this.dateTime = new Date();
this.serviceUrl = serviceUrl;
$scope.$watch(
function () {
return annotationUI.frames();
},
function (frames) {
if (frames.length === 0) {
return;
}
this.url = frames[0].uri;
this.documentFingerprint = frames[0].documentFingerprint;
}.bind(this)
);
},
restrict: 'E',
template: require('../templates/help_panel.html'),
scope: {
auth: '<',
onClose: '&',
},
};
$scope.$watch(
function () {
return annotationUI.frames();
},
function (frames) {
if (frames.length === 0) {
return;
}
this.url = frames[0].uri;
this.documentFingerprint = frames[0].documentFingerprint;
}.bind(this)
);
},
template: require('../templates/help_panel.html'),
bindings: {
auth: '<',
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