aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/tests/js/filelistSpec.js4
-rw-r--r--core/js/apps.js13
-rw-r--r--core/js/tests/specs/appsSpec.js4
3 files changed, 16 insertions, 5 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 97fa9804a22..651ba6eef1e 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -2063,6 +2063,7 @@ describe('OCA.Files.FileList tests', function() {
expect(fileList._detailsView.getFileInfo()).toEqual(null);
});
it('closes sidebar whenever the currently highlighted file was removed from the list', function() {
+ jQuery.fx.off = true;
var $tr = fileList.findFileEl('One.txt');
$tr.find('td.filename>a.name').click();
expect($tr.hasClass('highlighted')).toEqual(true);
@@ -2072,6 +2073,7 @@ describe('OCA.Files.FileList tests', function() {
expect($('#app-sidebar').hasClass('disappear')).toEqual(false);
fileList.remove('One.txt');
expect($('#app-sidebar').hasClass('disappear')).toEqual(true);
+ jQuery.fx.off = false;
});
it('returns the currently selected model instance when calling getModelForFile', function() {
var $tr = fileList.findFileEl('One.txt');
@@ -2088,12 +2090,14 @@ describe('OCA.Files.FileList tests', function() {
expect(model3).toEqual(model1);
});
it('closes the sidebar when switching folders', function() {
+ jQuery.fx.off = true;
var $tr = fileList.findFileEl('One.txt');
$tr.find('td.filename>a.name').click();
expect($('#app-sidebar').hasClass('disappear')).toEqual(false);
fileList.changeDirectory('/another');
expect($('#app-sidebar').hasClass('disappear')).toEqual(true);
+ jQuery.fx.off = false;
});
});
describe('File actions', function() {
diff --git a/core/js/apps.js b/core/js/apps.js
index d8f4bfdf1c5..a2d3460c907 100644
--- a/core/js/apps.js
+++ b/core/js/apps.js
@@ -27,9 +27,9 @@
*/
exports.Apps.showAppSidebar = function($el) {
var $appSidebar = $el || $('#app-sidebar');
- $appSidebar.removeClass('disappear');
- $('#app-content').addClass('with-app-sidebar').trigger(new $.Event('appresized'));
-
+ $appSidebar.removeClass('disappear')
+ .show('slide', { direction: 'right' }, 200);
+ $('#app-content').addClass('with-app-sidebar', 200).trigger(new $.Event('appresized'));
};
/**
@@ -40,8 +40,11 @@
*/
exports.Apps.hideAppSidebar = function($el) {
var $appSidebar = $el || $('#app-sidebar');
- $appSidebar.addClass('disappear');
- $('#app-content').removeClass('with-app-sidebar').trigger(new $.Event('appresized'));
+ $appSidebar.hide('slide', { direction: 'right' }, 100,
+ function() {
+ $appSidebar.addClass('disappear');
+ });
+ $('#app-content').removeClass('with-app-sidebar', 100).trigger(new $.Event('appresized'));
};
/**
diff --git a/core/js/tests/specs/appsSpec.js b/core/js/tests/specs/appsSpec.js
index 536d41c7f10..c3352e3e4a9 100644
--- a/core/js/tests/specs/appsSpec.js
+++ b/core/js/tests/specs/appsSpec.js
@@ -23,6 +23,10 @@ describe('Apps base tests', function() {
describe('Sidebar utility functions', function() {
beforeEach(function() {
$('#testArea').append('<div id="app-content">Content</div><div id="app-sidebar">The sidebar</div>');
+ jQuery.fx.off = true;
+ });
+ afterEach(function() {
+ jQuery.fx.off = false;
});
it('shows sidebar', function() {
var $el = $('#app-sidebar');