Merge branch 'master' into develop

This commit is contained in:
Torkel Ödegaard
2017-11-02 15:56:09 +01:00
109 changed files with 844 additions and 801 deletions

View File

@@ -1,23 +0,0 @@
define([
'../core_module',
],
function (coreModule) {
'use strict';
coreModule.default.directive('confirmClick', function() {
return {
restrict: 'A',
link: function(scope, elem, attrs) {
elem.bind('click', function() {
var message = attrs.confirmation || "Are you sure you want to do that?";
if (window.confirm(message)) {
var action = attrs.confirmClick;
if (action) {
scope.$apply(scope.$eval(action));
}
}
});
},
};
});
});

View File

@@ -1,11 +1,8 @@
define([
'../core_module',
'app/core/utils/rangeutil',
],
function (coreModule, rangeUtil) {
'use strict';
import coreModule from '../core_module';
import * as rangeUtil from 'app/core/utils/rangeutil';
coreModule.default.directive('ngModelOnblur', function() {
export class NgModelOnBlur {
constructor() {
return {
restrict: 'A',
priority: 1,
@@ -23,22 +20,27 @@ function (coreModule, rangeUtil) {
});
}
};
});
}
}
coreModule.default.directive('emptyToNull', function () {
export class EmptyToNull {
constructor() {
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
ctrl.$parsers.push(function (viewValue) {
if(viewValue === "") { return null; }
if (viewValue === "") { return null; }
return viewValue;
});
}
};
});
}
}
coreModule.default.directive('validTimeSpan', function() {
export class ValidTimeSpan {
constructor() {
return {
require: 'ngModel',
link: function(scope, elm, attrs, ctrl) {
@@ -54,5 +56,9 @@ function (coreModule, rangeUtil) {
};
}
};
});
});
}
}
coreModule.directive('ngModelOnblur', NgModelOnBlur);
coreModule.directive('emptyToNull', EmptyToNull);
coreModule.directive('validTimeSpan', ValidTimeSpan);