Use global apps slide toggle logic

Remove local app settings slide logic and make it use the global one
triggered by the "data-apps-slide-toggle" attribute.
This commit is contained in:
Vincent Petry 2014-08-11 16:34:24 +02:00
parent e1a47683ef
commit c208796c47
2 changed files with 2 additions and 26 deletions

View file

@ -289,28 +289,4 @@ $(document).ready( function () {
$userGroupList.on('click', '.isgroup', function () {
GroupList.showGroup(GroupList.getElementGID(this));
});
// Implements Quota Settings Toggle.
var $appSettings = $('#app-settings');
$('#app-settings-header').on('click keydown',function(event) {
if(wrongKey(event)) {
return;
}
if($appSettings.hasClass('open')) {
$appSettings.switchClass('open', '');
} else {
$appSettings.switchClass('', 'open');
}
});
$('body').on('click', function(event){
if($appSettings.find(event.target).length === 0) {
$appSettings.switchClass('open', '');
}
});
});
var wrongKey = function(event) {
return ((event.type === 'keydown' || event.type === 'keypress') &&
(event.keyCode !== 32 && event.keyCode !== 13));
};

View file

@ -1,5 +1,5 @@
<div id="app-settings-header">
<button class="settings-button" tabindex="0"></button>
<button class="settings-button" tabindex="0" data-apps-slide-toggle="#app-settings-content"></button>
</div>
<div id="app-settings-content">
<div class="quota">
@ -36,4 +36,4 @@
</select>
<?php endif; ?>
</div>
</div>
</div>