* Fix save 0 steps/mm- now it shows an error if steps<-0
This commit is contained in:
committed by
GitHub
parent
6a02270135
commit
29ff606e33
@@ -1,7 +1,8 @@
|
||||
$(function () {
|
||||
function CalibrationToolsGeneralViewModel(parameters) {
|
||||
this.loginState = parameters[0];
|
||||
this.decimal3 = function (defaultVal) {
|
||||
var self = this;
|
||||
self.decimal3 = function (defaultVal) {
|
||||
return {
|
||||
numeric: {
|
||||
decimals: 3,
|
||||
@@ -9,7 +10,7 @@ $(function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.isSmall = ko.observable($("#tab_plugin_CalibrationTools").width() < 800);
|
||||
self.isSmall = ko.observable($("#tab_plugin_CalibrationTools").width() < 800);
|
||||
ko.extenders.numeric = function (target, options) {
|
||||
var returnObs = ko.pureComputed({
|
||||
read: target,
|
||||
@@ -24,9 +25,33 @@ $(function () {
|
||||
return returnObs;
|
||||
};
|
||||
|
||||
this.onStartupComplete = function () {
|
||||
self.onStartupComplete = function () {
|
||||
this.isSmall($("#tabs_content").width() < 800);
|
||||
}
|
||||
self.notify = function (title, message, type, hide) {
|
||||
new PNotify({
|
||||
title: title,
|
||||
text: message,
|
||||
type: type,
|
||||
hide: hide
|
||||
});
|
||||
}
|
||||
self.notifyError = function (title, message) {
|
||||
self.notify(title, message, 'error', false);
|
||||
}
|
||||
self.notifyInfo = function (title, message) {
|
||||
self.notify(title, message, 'info', true);
|
||||
}
|
||||
self.notifyWarning = function (title, message) {
|
||||
self.notify(title, message, 'warning', false);
|
||||
}
|
||||
self.failedFunction = function (response) {
|
||||
self.notifyError("Error", response.responseJSON.error);
|
||||
}
|
||||
self.round = function (number, decimals) {
|
||||
decimals = decimals ? decimals : 3;
|
||||
return +(Math.round(number + ("e+" + decimals)) + ("e-" + decimals));
|
||||
}
|
||||
}
|
||||
OCTOPRINT_VIEWMODELS.push({
|
||||
// This is the constructor to call for instantiating the plugin
|
||||
|
||||
Reference in New Issue
Block a user