Auto hide selection panel when selecting a set of cards

This commit is contained in:
Giulio Cesare Solaroli 2015-10-01 16:40:35 +02:00
parent 73165361d4
commit 313fd48551

View File

@ -75,7 +75,7 @@ Clipperz.PM.UI.MainController = function() {
'importCards', 'importCards',
'downloadExport', 'downloadExport',
'updateProgress', 'updateProgress',
'toggleSelectionPanel', 'toggleSettingsPanel', 'toggleSelectionPanel', 'hideSelectionPanel', 'toggleSettingsPanel',
'matchMediaQuery', 'unmatchMediaQuery', 'matchMediaQuery', 'unmatchMediaQuery',
'selectAllCards', 'selectRecentCards', 'search', 'tagSelected', 'selectUntaggedCards', 'selectAllCards', 'selectRecentCards', 'search', 'tagSelected', 'selectUntaggedCards',
'refreshCardEditDetail', 'refreshCardEditDetail',
@ -1339,6 +1339,12 @@ Clipperz.log("THE BROWSER IS OFFLINE");
} }
}, },
hideSelectionPanel_handler: function (anEvent) {
if (this.isSelectionPanelOpen()) {
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'toggleSelectionPanel');
}
},
isSettingsPanelOpen: function () { isSettingsPanelOpen: function () {
return this._isSettingsPanelOpen; return this._isSettingsPanelOpen;
}, },
@ -1881,12 +1887,14 @@ Clipperz.log("THE BROWSER IS OFFLINE");
this.setPageProperties('mainPage', 'searchTerm', ''); this.setPageProperties('mainPage', 'searchTerm', '');
this.resetSelectedCard(); this.resetSelectedCard();
this.setFilter('ALL'); this.setFilter('ALL');
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'hideSelectionPanel');
return this.refreshSelectedCards(); return this.refreshSelectedCards();
}, },
selectRecentCards_handler: function () { selectRecentCards_handler: function () {
this.resetSelectedCard(); this.resetSelectedCard();
this.setFilter('RECENT'); this.setFilter('RECENT');
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'hideSelectionPanel');
return this.refreshSelectedCards(); return this.refreshSelectedCards();
}, },
@ -1906,12 +1914,14 @@ Clipperz.log("THE BROWSER IS OFFLINE");
tagSelected_handler: function (aTag) { tagSelected_handler: function (aTag) {
this.resetSelectedCard(); this.resetSelectedCard();
this.setFilter('TAG', aTag); this.setFilter('TAG', aTag);
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'hideSelectionPanel');
return this.refreshSelectedCards(); return this.refreshSelectedCards();
}, },
selectUntaggedCards_handler: function () { selectUntaggedCards_handler: function () {
this.resetSelectedCard(); this.resetSelectedCard();
this.setFilter('UNTAGGED'); this.setFilter('UNTAGGED');
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'hideSelectionPanel');
return this.refreshSelectedCards(); return this.refreshSelectedCards();
}, },