Skip to content

Commit

Permalink
🐛 Remove disablePointer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul de Vries committed Dec 30, 2016
1 parent 58aab12 commit 9867a35
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 55 deletions.
111 changes: 58 additions & 53 deletions octoprint_touchui/static/js/touchui.bundled.js
Expand Up @@ -49,8 +49,7 @@ TouchUI.prototype = {
mouseWheel: true,
interactiveScrollbars: true,
shrinkScrollbars: "scale",
fadeScrollbars: true,
disablePointer: true
fadeScrollbars: true
}
},

Expand Down Expand Up @@ -1180,6 +1179,12 @@ TouchUI.prototype.knockout.isLoading = function (viewModels) {
if(self.isActive()) {
self.components.touchscreen.isLoading.call(self, viewModels);

// Reload dimensions of webcam with onload event
// Fixes bug #78
$("#webcam_image").on("load", function() {
viewModels.controlViewModel.updateRotatorWidth();
});

// Prevent user from double clicking in a short period on buttons
$(document).on("click", "button:not(#login_button, .box, .distance, .dropdown-toggle)", function(e) {
var printer = $(e.target);
Expand Down Expand Up @@ -1444,57 +1449,6 @@ TouchUI.prototype.knockout.viewModel = function() {

}

TouchUI.prototype.plugins.navbarTemp = function() {

// Manually move navbar temp (hard move)
if( $("#navbar_plugin_navbartemp").length > 0 ) {
var navBarTmp = $("#navbar_plugin_navbartemp").appendTo(this.DOM.create.dropdown.container);
$('<li class="divider"></li>').insertBefore(navBarTmp);
}

}

TouchUI.prototype.plugins.screenSquish = function(pluginManagerViewModel) {
var shown = false;

pluginManagerViewModel.plugins.items.subscribe(function() {

var ScreenSquish = pluginManagerViewModel.plugins.getItem(function(elm) {
return (elm.key === "ScreenSquish");
}, true) || false;

if(!shown && ScreenSquish && ScreenSquish.enabled) {
shown = true;
new PNotify({
title: 'TouchUI: ScreenSquish is running',
text: 'Running ScreenSquish and TouchUI will give issues since both plugins try the same, we recommend turning off ScreenSquish.',
icon: 'glyphicon glyphicon-question-sign',
type: 'error',
hide: false,
confirm: {
confirm: true,
buttons: [{
text: 'Disable ScreenSquish',
addClass: 'btn-primary',
click: function(notice) {
if(!ScreenSquish.pending_disable) {
pluginManagerViewModel.togglePlugin(ScreenSquish);
}
notice.remove();
}
}]
},
});
}

});

};

TouchUI.prototype.plugins.init = function (viewModels) {
this.plugins.screenSquish(viewModels.pluginManagerViewModel);
}

TouchUI.prototype.scroll.blockEvents = {
className: "no-pointer",

Expand Down Expand Up @@ -1828,6 +1782,57 @@ TouchUI.prototype.scroll.init = function() {

}

TouchUI.prototype.plugins.navbarTemp = function() {

// Manually move navbar temp (hard move)
if( $("#navbar_plugin_navbartemp").length > 0 ) {
var navBarTmp = $("#navbar_plugin_navbartemp").appendTo(this.DOM.create.dropdown.container);
$('<li class="divider"></li>').insertBefore(navBarTmp);
}

}

TouchUI.prototype.plugins.screenSquish = function(pluginManagerViewModel) {
var shown = false;

pluginManagerViewModel.plugins.items.subscribe(function() {

var ScreenSquish = pluginManagerViewModel.plugins.getItem(function(elm) {
return (elm.key === "ScreenSquish");
}, true) || false;

if(!shown && ScreenSquish && ScreenSquish.enabled) {
shown = true;
new PNotify({
title: 'TouchUI: ScreenSquish is running',
text: 'Running ScreenSquish and TouchUI will give issues since both plugins try the same, we recommend turning off ScreenSquish.',
icon: 'glyphicon glyphicon-question-sign',
type: 'error',
hide: false,
confirm: {
confirm: true,
buttons: [{
text: 'Disable ScreenSquish',
addClass: 'btn-primary',
click: function(notice) {
if(!ScreenSquish.pending_disable) {
pluginManagerViewModel.togglePlugin(ScreenSquish);
}
notice.remove();
}
}]
},
});
}

});

};

TouchUI.prototype.plugins.init = function (viewModels) {
this.plugins.screenSquish(viewModels.pluginManagerViewModel);
}

TouchUI.prototype.DOM.create.dropdown = {

menuItem: {
Expand Down
3 changes: 1 addition & 2 deletions source/js/constructor.js
Expand Up @@ -49,8 +49,7 @@ TouchUI.prototype = {
mouseWheel: true,
interactiveScrollbars: true,
shrinkScrollbars: "scale",
fadeScrollbars: true,
disablePointer: true
fadeScrollbars: true
}
},

Expand Down

0 comments on commit 9867a35

Please sign in to comment.