Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Fix selected options
Browse files Browse the repository at this point in the history
  • Loading branch information
NastuzziSamy committed Jan 16, 2019
1 parent a9f1899 commit 6d0c06d
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
var options = new RightClick.Options();
var openSubOptions = new RightClick.Options();
var currentFile = $(event.target).closest('tr');
var selectedActions = '.selectedActions .menu-center li';
currentFile.find('.action-menu').click();
$('.actions-selected').click().click();

var menu = currentFile.find('.fileActionsMenu');
var menuStyle = $('style.rightClickStyle');
var selectedActionsList = $('.selectedActions');
var generateNewOption = function (action, icon, text, onClick, prepend, subOptions) {
return new RightClick.Option(action, text, 'icon-' + icon, typeof onClick === 'function' ? function (event, context) {
event.stopPropagation();
Expand Down Expand Up @@ -62,16 +63,12 @@
$(currentFile.find('input.selectCheckBox')).click();
});

$.each(selectedActionsList, function (i, selectedActions) {
$.each($(selectedActions).find('a'), function (j, selectedAction) {
var action = $(selectedAction);
$.each($('.selectedActions .menu-center li'), function (i, selectedAction) {
var action = $(selectedAction);

if (action.is(":visible")) {
addNewOption(action.attr('class'), $(action.find('span.icon')).attr('class').replace('icon', '').replace(' ', '').replace('icon-', ''), $(action.find('span:not(.icon)')).text(), function () {
action.click()
}, false);
}
});
addNewOption(action.attr('class'), $(action.find('span.icon')).attr('class').replace('icon', '').replace(' ', '').replace('icon-', ''), $(action.find('span:not(.icon)')).text(), function () {
action.find('a').click();
}, false);
});
}
else {
Expand Down Expand Up @@ -167,7 +164,5 @@
}, 250);

return options;
}, $('#controls').css('z-index') - 1).setContext(function (event) {
return $('#app-content-files #fileList');
});
}, $('#app-content-files #fileList'));
})(window, jQuery, RightClick);

0 comments on commit 6d0c06d

Please sign in to comment.