mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
fix number spinner input issues with scheduler
This commit is contained in:
@@ -996,7 +996,11 @@ angular.module('AngularScheduler', ['underscore'])
|
|||||||
.filter('schZeroPad', [ function() {
|
.filter('schZeroPad', [ function() {
|
||||||
return function (n, pad) {
|
return function (n, pad) {
|
||||||
var str = (Math.pow(10,pad) + '').replace(/^1/,'') + (n + '').trim();
|
var str = (Math.pow(10,pad) + '').replace(/^1/,'') + (n + '').trim();
|
||||||
return str.substr(str.length - pad);
|
if (str.substr(str.length - pad) === 'll') {
|
||||||
|
return undefined;
|
||||||
|
} else {
|
||||||
|
return str.substr(str.length - pad);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}])
|
}])
|
||||||
|
|
||||||
@@ -1052,6 +1056,10 @@ angular.module('AngularScheduler', ['underscore'])
|
|||||||
return {
|
return {
|
||||||
require: 'ngModel',
|
require: 'ngModel',
|
||||||
link: function(scope, element, attr, ctrl) {
|
link: function(scope, element, attr, ctrl) {
|
||||||
|
if (element.attr("ng-model").indexOf("$parent") > -1) {
|
||||||
|
scope = scope.$parent;
|
||||||
|
attr.ngModel = attr.ngModel.split("$parent.")[1];
|
||||||
|
}
|
||||||
// Add jquerui spinner to 'spinner' type input
|
// Add jquerui spinner to 'spinner' type input
|
||||||
var form = attr.schSpinner,
|
var form = attr.schSpinner,
|
||||||
zeroPad = attr.zeroPad,
|
zeroPad = attr.zeroPad,
|
||||||
@@ -1076,16 +1084,25 @@ angular.module('AngularScheduler', ['underscore'])
|
|||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
},
|
},
|
||||||
|
icons: {
|
||||||
|
down: "Form-numberInputButton fa fa-angle-down",
|
||||||
|
up: "Form-numberInputButton fa fa-angle-up"
|
||||||
|
},
|
||||||
spin: function() {
|
spin: function() {
|
||||||
scope[form].$setDirty();
|
if (scope[form][attr.ngModel]) {
|
||||||
ctrl.$dirty = true;
|
scope[form][attr.ngModel].$setDirty();
|
||||||
ctrl.$pristine = false;
|
scope[form][attr.ngModel].$dirty = true;
|
||||||
|
scope[form][attr.ngModel].$pristine = false;
|
||||||
|
}
|
||||||
if (!scope.$$phase) {
|
if (!scope.$$phase) {
|
||||||
scope.$digest();
|
scope.$digest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.ui-icon').text('');
|
||||||
|
$(".ui-icon").removeClass('ui-icon ui-icon-triangle-1-n ui-icon-triangle-1-s');
|
||||||
|
|
||||||
$(element).on("click", function () {
|
$(element).on("click", function () {
|
||||||
$(element).select();
|
$(element).select();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user