Skip to content

Commit

Permalink
let's get rid of the longclick
Browse files Browse the repository at this point in the history
Conflicts:
	cms/static/cms/js/modules/cms.plugins.js
  • Loading branch information
FinalAngel authored and yakky committed Apr 15, 2015
1 parent caa8e5b commit 043b029
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions cms/static/cms/js/modules/cms.plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,6 @@ $(document).ready(function () {
that.copyPlugin(data);
});

// adds longclick events
this.container.bind('mousedown mouseup mousemove', function (e) {
if(e.type !== 'mousemove') e.stopPropagation();
if(e.type === 'mousedown' && (e.which !== 3 || e.button !== 2)) {
// start countdown
timer = setTimeout(function () {
CMS.API.StructureBoard.setActive(that.options.plugin_id, true);
}, 500);
} else {
clearTimeout(timer);
}
});

// variables for dragitems
var draggable = $('.cms_draggable-' + this.options.plugin_id);
var dragitem = draggable.find('> .cms_dragitem');
Expand Down Expand Up @@ -178,25 +165,6 @@ $(document).ready(function () {
e.stopPropagation();
that.editPlugin(that.options.urls.edit_plugin, that.options.plugin_name, that.options.plugin_breadcrumb);
});

// adds longclick events
dragitem.bind('mousedown mouseup mousemove', function (e) {
if(e.type === 'mousedown') {
// start countdown
timer = setTimeout(function () {
CMS.API.StructureBoard.setActive(that.options.plugin_id, false);
// prevent dragging
$(document).bind('mousemove.keypress', function () {
$(document).trigger('keyup.cms', [true]);
setTimeout(function () {
$(document).unbind('mousemove.keypress');
}, 1000);
});
}, 500);
} else {
clearTimeout(timer);
}
});
},

_setGeneric: function () {
Expand Down Expand Up @@ -476,8 +444,6 @@ $(document).ready(function () {
_setSubnav: function (nav) {
var that = this;

nav.bind('mousedown', function (e) { e.stopPropagation(); }); // avoid starting the longclick event when using the drag bar

nav.bind('mouseenter mouseleave tap.cms', function (e) {
e.preventDefault();
e.stopPropagation();
Expand Down Expand Up @@ -817,4 +783,4 @@ $(document).ready(function () {
});

});
})(CMS.$);
})(CMS.$);

0 comments on commit 043b029

Please sign in to comment.