From 2fe71bdc48f2a6f46b026d536fddcea13ea93d8e Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 29 Oct 2014 17:15:14 +0000 Subject: [PATCH] Cancel d-n-d action on taglist item edit button --- mail/js/app.js | 23 ++++++++++++----------- mail/templates/pixelegg/app.css | 4 +++- mail/templates/pixelegg/app.less | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 30f593afc6..e97b83b13f 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -3936,9 +3936,9 @@ app.classes.mail = AppJS.extend( set_dragging_dndCompose: function () { var zIndex = 100; - var self = this; - - jQuery('div.ms-sel-item:not(div.ui-draggable)').draggable({ + var dragItem = jQuery('div.ms-sel-item:not(div.ui-draggable)'); + + dragItem.draggable({ appendTo:'body', //Performance wise better to not add ui-draggable class to items since we are not using that class containment:'document', @@ -3946,7 +3946,7 @@ app.classes.mail = AppJS.extend( cursor:'move', cursorAt:{left:2}, //cancel dragging on close button to avoid conflict with close action - cancel:'.ms-close-btn', + cancel:'.ms-close-btn, .ms-edit-btn', /** * function to act on draggable item on revert's event * @returns {Boolean} return true @@ -3963,14 +3963,14 @@ app.classes.mail = AppJS.extend( */ start:function(event, ui) { - if (event.ctrlKey) + var dragItem = jQuery(this); + if (event.ctrlKey || event.metaKey) { - jQuery(this) - .addClass('mailCompose_copyEmail') + dragItem.addClass('mailCompose_copyEmail') .css('cursor','copy'); } - jQuery(this).css ('z-index',zIndex++); - jQuery(this).css('position','absolute'); + dragItem.css ('z-index',zIndex++); + dragItem.css('position','absolute'); }, /** * @@ -3992,12 +3992,13 @@ app.classes.mail = AppJS.extend( { var self = this; + var emailTags = jQuery('#mail-compose_to,#mail-compose_cc,#mail-compose_bcc'); //Call to make new items draggable - jQuery('#mail-compose_to,#mail-compose_cc,#mail-compose_bcc').hover(function(){ + emailTags.hover(function(){ self.set_dragging_dndCompose(); }); //Make used email-tag list widgets in mail compose droppable - jQuery('#mail-compose_to,#mail-compose_cc,#mail-compose_bcc').droppable({ + emailTags.droppable({ access:'.ms-sel-item', /** diff --git a/mail/templates/pixelegg/app.css b/mail/templates/pixelegg/app.css index 0226c8b39c..de85914d55 100755 --- a/mail/templates/pixelegg/app.css +++ b/mail/templates/pixelegg/app.css @@ -1310,7 +1310,9 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje padding-right: 5px; } #mail-compose .mailComposeHeaders span.ms-close-btn, -#mail-compose .mailComposeHeadersSection span.ms-close-btn { +#mail-compose .mailComposeHeadersSection span.ms-close-btn, +#mail-compose .mailComposeHeaders span.ms-edit-btn, +#mail-compose .mailComposeHeadersSection span.ms-edit-btn { width: auto; background-repeat: no-repeat; padding-right: 8px; diff --git a/mail/templates/pixelegg/app.less b/mail/templates/pixelegg/app.less index e0bfb8a3d5..36dcbba42e 100755 --- a/mail/templates/pixelegg/app.less +++ b/mail/templates/pixelegg/app.less @@ -569,7 +569,7 @@ div#mail-index{ padding-right: 5px; } - span.ms-close-btn { + span.ms-close-btn, span.ms-edit-btn{ width: auto; background-repeat: no-repeat; padding-right: 8px;