Skip to content

Commit

Permalink
- improved "lazy delete" signatures toggle button. Now becomes "inact…
Browse files Browse the repository at this point in the history
…ive" after each `ctrl`+`v` update action, closed #724
  • Loading branch information
exodus4d committed Jul 19, 2019
1 parent 8c5385e commit 6ad71fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions js/app/ui/module/system_signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -2355,8 +2355,7 @@ define([

// "lazy update" toggle ---------------------------------------------------------------------------------------
moduleElement.find('.' + config.moduleHeadlineIconLazyClass).on('click', function(e){
let button = $(this);
button.toggleClass('active');
$(this).toggleClass('active');
});

// set multi row select ---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -2387,9 +2386,14 @@ define([

// event listener for global "paste" signatures into the page -------------------------------------------------
moduleElement.on('pf:updateSystemSignatureModuleByClipboard', {tableApi: primaryTableApi}, function(e, clipboard){
let lazyUpdateToggle = moduleElement.find('.' + config.moduleHeadlineIconLazyClass);
let signatureOptions = {
deleteOld: moduleElement.find('.' + config.moduleHeadlineIconLazyClass).hasClass('active') ? 1 : 0
deleteOld: lazyUpdateToggle.hasClass('active') ? 1 : 0
};

// "disable" lazy update icon -> prevents accidental removal for next paste #724
lazyUpdateToggle.toggleClass('active', false);

updateSignatureTableByClipboard(e.data.tableApi, systemData, clipboard, signatureOptions);
});

Expand Down
10 changes: 7 additions & 3 deletions public/js/v1.5.2/app/ui/module/system_signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -2355,8 +2355,7 @@ define([

// "lazy update" toggle ---------------------------------------------------------------------------------------
moduleElement.find('.' + config.moduleHeadlineIconLazyClass).on('click', function(e){
let button = $(this);
button.toggleClass('active');
$(this).toggleClass('active');
});

// set multi row select ---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -2387,9 +2386,14 @@ define([

// event listener for global "paste" signatures into the page -------------------------------------------------
moduleElement.on('pf:updateSystemSignatureModuleByClipboard', {tableApi: primaryTableApi}, function(e, clipboard){
let lazyUpdateToggle = moduleElement.find('.' + config.moduleHeadlineIconLazyClass);
let signatureOptions = {
deleteOld: moduleElement.find('.' + config.moduleHeadlineIconLazyClass).hasClass('active') ? 1 : 0
deleteOld: lazyUpdateToggle.hasClass('active') ? 1 : 0
};

// "disable" lazy update icon -> prevents accidental removal for next paste #724
lazyUpdateToggle.toggleClass('active', false);

updateSignatureTableByClipboard(e.data.tableApi, systemData, clipboard, signatureOptions);
});

Expand Down

0 comments on commit 6ad71fd

Please sign in to comment.