Browse Source

added this.wiggling for scope call

version-14
Achilles Rasquinha 7 years ago
parent
commit
da76dd5f7a
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      frappe/core/page/desktop/desktop.js

+ 5
- 5
frappe/core/page/desktop/desktop.js View File

@@ -112,7 +112,7 @@ $.extend(frappe.desktop, {
}, },


setup_module_click: function() { setup_module_click: function() {
var wiggling = false; // wiggle, wiggle, wiggle.
this.wiggling = false; // wiggle, wiggle, wiggle.


if(frappe.list_desktop) { if(frappe.list_desktop) {
frappe.desktop.wrapper.on("click", ".desktop-list-item", function() { frappe.desktop.wrapper.on("click", ".desktop-list-item", function() {
@@ -120,7 +120,7 @@ $.extend(frappe.desktop, {
}); });
} else { } else {
frappe.desktop.wrapper.on("click", ".app-icon", function() { frappe.desktop.wrapper.on("click", ".app-icon", function() {
if ( !wiggling ) {
if ( !this.wiggling ) {
frappe.desktop.open_module($(this).parent()); frappe.desktop.open_module($(this).parent());
} }
}); });
@@ -159,7 +159,7 @@ $.extend(frappe.desktop, {


$icons.trigger('stopRumble'); $icons.trigger('stopRumble');


wiggling = false;
this.wiggling = false;
}; };


// initiate wiggling. // initiate wiggling.
@@ -169,7 +169,7 @@ $.extend(frappe.desktop, {


frappe.desktop.wrapper.on('mousedown', '.app-icon', () => { frappe.desktop.wrapper.on('mousedown', '.app-icon', () => {
timer_id = setTimeout(() => { timer_id = setTimeout(() => {
wiggling = true;
this.wiggling = true;
// hide all notifications. // hide all notifications.
$notis.hide(); $notis.hide();
@@ -231,7 +231,7 @@ $.extend(frappe.desktop, {


// also stop wiggling if clicked elsewhere. // also stop wiggling if clicked elsewhere.
$('body').click((event) => { $('body').click((event) => {
if ( wiggling ) {
if ( this.wiggling ) {
const $target = $(event.target); const $target = $(event.target);
// our target shouldn't be .app-icons or .close // our target shouldn't be .app-icons or .close
const $parent = $target.parents('.case-wrapper'); const $parent = $target.parents('.case-wrapper');


Loading…
Cancel
Save