aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/css/files.scss4
-rw-r--r--apps/files/css/mobile.scss22
-rw-r--r--apps/files/templates/list.php4
-rw-r--r--apps/files_external/js/mountsfilelist.js3
-rw-r--r--apps/files_external/js/statusmanager.js10
-rw-r--r--apps/files_trashbin/templates/index.php4
-rw-r--r--apps/user_ldap/lib/Access.php7
-rw-r--r--apps/user_ldap/lib/Connection.php2
-rw-r--r--build/package.json1
-rw-r--r--core/css/variables.scss2
-rw-r--r--core/js/js.js37
-rw-r--r--core/js/tests/specs/coreSpec.js427
-rw-r--r--core/vendor/core.js6
-rw-r--r--core/vendor/snapjs/dist/latest/snap.js6
-rw-r--r--issue_template.md4
-rw-r--r--tests/karma.config.js2
16 files changed, 526 insertions, 15 deletions
diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss
index 00060ee7bd6..b29ce9ea950 100644
--- a/apps/files/css/files.scss
+++ b/apps/files/css/files.scss
@@ -542,6 +542,10 @@ a.action > img {
vertical-align: text-bottom;
margin-bottom: -1px;
}
+/* hide the delete icon in name column normal resolutions */
+table th#headerName .selectedActions .delete-selected {
+ display: none;
+}
#fileList td a {
a.action {
diff --git a/apps/files/css/mobile.scss b/apps/files/css/mobile.scss
index 10fa29e7a38..703ae499835 100644
--- a/apps/files/css/mobile.scss
+++ b/apps/files/css/mobile.scss
@@ -12,7 +12,6 @@
min-width: initial !important;
}
-/* hide size and date columns */
table th#headerSize,
table td.filesize,
table th#headerDate,
@@ -52,6 +51,11 @@ table td.filename .nametext .innernametext {
max-width: calc(100% - 175px) !important;
}
+/* show the delete icon in name column in lower resolutions */
+table th#headerName .selectedActions .delete-selected {
+ display: inline;
+}
+
/* proper notification area for multi line messages */
#notification-container {
display: flex;
@@ -75,3 +79,19 @@ table.dragshadow {
}
}
+@media only screen and (max-width: 480px) {
+ /* Only show icons */
+ table th .selectedActions a span:not(.icon) {
+ display: none;
+ }
+
+ /* Increase touch area for the icons */
+ table th .selectedActions a {
+ padding: 17px 14px;
+ }
+
+ /* Remove the margin to reduce the overlap between the name and the icons */
+ table.multiselect th .columntitle.name {
+ margin-left: 0;
+ }
+}
diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php
index 92f64a52a28..fd5423c334f 100644
--- a/apps/files/templates/list.php
+++ b/apps/files/templates/list.php
@@ -59,6 +59,10 @@
<span class="icon icon-download"></span>
<span><?php p($l->t('Download'))?></span>
</a>
+ <a href="" class="delete-selected">
+ <span class="icon icon-delete"></span>
+ <span><?php p($l->t('Delete'))?></span>
+ </a>
</span>
</div>
</th>
diff --git a/apps/files_external/js/mountsfilelist.js b/apps/files_external/js/mountsfilelist.js
index 3beee6f73b2..90b90e38745 100644
--- a/apps/files_external/js/mountsfilelist.js
+++ b/apps/files_external/js/mountsfilelist.js
@@ -30,6 +30,8 @@
/** @lends OCA.External.FileList.prototype */ {
appName: 'External storages',
+ _allowSelection: false,
+
/**
* @private
*/
@@ -56,7 +58,6 @@
$scopeColumn.find('span').text(scopeText);
$backendColumn.text(fileData.backend);
$tr.find('td.filename').after($scopeColumn).after($backendColumn);
- $tr.find('td.filename input:checkbox').remove();
return $tr;
},
diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js
index 6c1a965c33d..3850351d213 100644
--- a/apps/files_external/js/statusmanager.js
+++ b/apps/files_external/js/statusmanager.js
@@ -489,7 +489,7 @@ OCA.External.StatusManager.Utils = {
}
});
- var icon = trFolder.find('td:first-child div.thumbnail');
+ var icon = trFolder.find('td.filename div.thumbnail');
icon.each(function () {
var thisElement = $(this);
if (thisElement.data('oldImage') === undefined) {
@@ -510,7 +510,7 @@ OCA.External.StatusManager.Utils = {
trFolder = $('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(folder) + '\"]');
}
trFolder.removeClass('externalErroredRow').removeClass('externalDisabledRow');
- var tdChilds = trFolder.find("td:first-child div.thumbnail");
+ var tdChilds = trFolder.find("td.filename div.thumbnail");
tdChilds.each(function () {
var thisElement = $(this);
thisElement.css('background-image', thisElement.data('oldImage'));
@@ -529,10 +529,10 @@ OCA.External.StatusManager.Utils = {
$.each(filename, function (index) {
route = OCA.External.StatusManager.Utils.getIconRoute($(this));
$(this).attr("data-icon", route);
- $(this).find('td:first-child div.thumbnail').css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline');
+ $(this).find('td.filename div.thumbnail').css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline');
});
} else {
- file = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td:first-child div.thumbnail");
+ file = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename div.thumbnail");
var parentTr = file.parents('tr:first');
route = OCA.External.StatusManager.Utils.getIconRoute(parentTr);
parentTr.attr("data-icon", route);
@@ -573,7 +573,7 @@ OCA.External.StatusManager.Utils = {
if (filename instanceof $) {
link = filename;
} else {
- link = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td:first-child a.name");
+ link = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename a.name");
}
if (active) {
link.off('click.connectivity');
diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php
index b3ebca2867b..a4459947d09 100644
--- a/apps/files_trashbin/templates/index.php
+++ b/apps/files_trashbin/templates/index.php
@@ -35,6 +35,10 @@
<span class="icon icon-history"></span>
<span><?php p($l->t('Restore'))?></span>
</a>
+ <a href="" class="delete-selected">
+ <span class="icon icon-delete"></span>
+ <span><?php p($l->t('Delete'))?></span>
+ </a>
</span>
</div>
</th>
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 27fda38a737..14d5b826f63 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -1095,8 +1095,11 @@ class Access extends LDAPUtility implements IUserTools {
$this->pagedSearchedSuccessful = true;
}
} else {
- if(!is_null($limit)) {
- \OCP\Util::writeLog('user_ldap', 'Paged search was not available', \OCP\Util::INFO);
+ if(!is_null($limit) && intval($this->connection->ldapPagingSize) !== 0) {
+ \OC::$server->getLogger()->debug(
+ 'Paged search was not available',
+ [ 'app' => 'user_ldap' ]
+ );
}
}
/* ++ Fixing RHDS searches with pages with zero results ++
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index bde489e2710..c73a35e6bf1 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -50,7 +50,7 @@ use OC\ServerNotAvailableException;
* @property boolean turnOnPasswordChange
* @property boolean hasPagedResultSupport
* @property string[] ldapBaseUsers
- * @property int|string ldapPagingSize holds an integer
+ * @property int|null ldapPagingSize holds an integer
* @property bool|mixed|void ldapGroupMemberAssocAttr
* @property string ldapUuidUserAttribute
* @property string ldapUuidGroupAttribute
diff --git a/build/package.json b/build/package.json
index b078727805d..e6688966693 100644
--- a/build/package.json
+++ b/build/package.json
@@ -22,6 +22,7 @@
"karma-jasmine-sinon": "^1.0.4",
"karma-junit-reporter": "*",
"karma-phantomjs-launcher": "*",
+ "karma-viewport": "^0.4.2",
"phantomjs-prebuilt": "*",
"node-sass": "~4.1.1",
"sinon": "*"
diff --git a/core/css/variables.scss b/core/css/variables.scss
index edeebd5403f..2e4e9028b30 100644
--- a/core/css/variables.scss
+++ b/core/css/variables.scss
@@ -15,7 +15,7 @@ $color-primary-element: $color-primary;
@return lighten($color, $value);
}
-$image-logo: '../img/logo-icon.svg?v=1';
+$image-logo: '../img/logo.svg?v=1';
$image-login-background: '../img/background.png?v=2';
$color-loading: #969696;
diff --git a/core/js/js.js b/core/js/js.js
index 31f415a1902..0b28310c728 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1612,12 +1612,47 @@ function initCore() {
snapper.close();
});
+ var navigationBarSlideGestureEnabled = false;
+ var navigationBarSlideGestureAllowed = true;
+ var navigationBarSlideGestureEnablePending = false;
+
+ OC.allowNavigationBarSlideGesture = function() {
+ navigationBarSlideGestureAllowed = true;
+
+ if (navigationBarSlideGestureEnablePending) {
+ snapper.enable();
+
+ navigationBarSlideGestureEnabled = true;
+ navigationBarSlideGestureEnablePending = false;
+ }
+ };
+
+ OC.disallowNavigationBarSlideGesture = function() {
+ navigationBarSlideGestureAllowed = false;
+
+ if (navigationBarSlideGestureEnabled) {
+ var endCurrentDrag = true;
+ snapper.disable(endCurrentDrag);
+
+ navigationBarSlideGestureEnabled = false;
+ navigationBarSlideGestureEnablePending = true;
+ }
+ };
+
var toggleSnapperOnSize = function() {
if($(window).width() > 768) {
snapper.close();
snapper.disable();
- } else {
+
+ navigationBarSlideGestureEnabled = false;
+ navigationBarSlideGestureEnablePending = false;
+ } else if (navigationBarSlideGestureAllowed) {
snapper.enable();
+
+ navigationBarSlideGestureEnabled = true;
+ navigationBarSlideGestureEnablePending = false;
+ } else {
+ navigationBarSlideGestureEnablePending = true;
}
};
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 9848fb46ffc..b6c617303cf 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -1112,4 +1112,431 @@ describe('Core base tests', function() {
expect(OC._ajaxConnectionLostHandler.calls.count()).toBe(1);
});
});
+ describe('Snapper', function() {
+ var snapConstructorStub;
+ var snapperStub;
+ var clock;
+
+ beforeEach(function() {
+ snapConstructorStub = sinon.stub(window, 'Snap');
+
+ snapperStub = {};
+ snapperStub.enable = sinon.stub();
+ snapperStub.disable = sinon.stub();
+ snapperStub.close = sinon.stub();
+
+ snapConstructorStub.returns(snapperStub);
+
+ clock = sinon.useFakeTimers();
+
+ // _.now could have been set to Date.now before Sinon replaced it
+ // with a fake version, so _.now must be stubbed to ensure that the
+ // fake Date.now will be called instead of the original one.
+ _.now = sinon.stub(_, 'now').callsFake(function() {
+ return new Date().getTime();
+ });
+
+ $('#testArea').append('<div id="app-navigation">The navigation bar</div><div id="app-content">Content</div>');
+ });
+ afterEach(function() {
+ snapConstructorStub.restore();
+
+ clock.restore();
+
+ _.now.restore();
+
+ // Remove the event handler for the resize event added to the window
+ // due to calling window.initCore() when there is an #app-navigation
+ // element.
+ $(window).off('resize');
+
+ viewport.reset();
+ });
+
+ it('is enabled on a narrow screen', function() {
+ viewport.set(480);
+
+ window.initCore();
+
+ expect(snapConstructorStub.calledOnce).toBe(true);
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.called).toBe(false);
+ });
+ it('is disabled when disallowing the gesture on a narrow screen', function() {
+ viewport.set(480);
+
+ window.initCore();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.called).toBe(false);
+ expect(snapperStub.close.called).toBe(false);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.disable.alwaysCalledWithExactly(true)).toBe(true);
+ expect(snapperStub.close.called).toBe(false);
+ });
+ it('is not disabled again when disallowing the gesture twice on a narrow screen', function() {
+ viewport.set(480);
+
+ window.initCore();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.called).toBe(false);
+ expect(snapperStub.close.called).toBe(false);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.disable.alwaysCalledWithExactly(true)).toBe(true);
+ expect(snapperStub.close.called).toBe(false);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.called).toBe(false);
+ });
+ it('is enabled when allowing the gesture after disallowing it on a narrow screen', function() {
+ viewport.set(480);
+
+ window.initCore();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.called).toBe(false);
+ expect(snapperStub.close.called).toBe(false);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.disable.alwaysCalledWithExactly(true)).toBe(true);
+ expect(snapperStub.close.called).toBe(false);
+
+ OC.allowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledTwice).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.called).toBe(false);
+ });
+ it('is not enabled again when allowing the gesture twice after disallowing it on a narrow screen', function() {
+ viewport.set(480);
+
+ window.initCore();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.called).toBe(false);
+ expect(snapperStub.close.called).toBe(false);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.disable.alwaysCalledWithExactly(true)).toBe(true);
+ expect(snapperStub.close.called).toBe(false);
+
+ OC.allowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledTwice).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.called).toBe(false);
+
+ OC.allowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledTwice).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.called).toBe(false);
+ });
+ it('is disabled on a wide screen', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapConstructorStub.calledOnce).toBe(true);
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ });
+ it('is not disabled again when disallowing the gesture on a wide screen', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+ });
+ it('is not enabled when allowing the gesture after disallowing it on a wide screen', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+
+ OC.allowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+ });
+ it('is enabled when resizing to a narrow screen', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ viewport.set(480);
+
+ // Setting the viewport width does not automatically trigger a
+ // resize.
+ $(window).resize();
+
+ // The resize handler is debounced to be executed a few milliseconds
+ // after the resize event.
+ clock.tick(1000);
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ });
+ it('is not enabled when resizing to a narrow screen after disallowing the gesture', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ viewport.set(480);
+
+ // Setting the viewport width does not automatically trigger a
+ // resize.
+ $(window).resize();
+
+ // The resize handler is debounced to be executed a few milliseconds
+ // after the resize event.
+ clock.tick(1000);
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ });
+ it('is enabled when resizing to a narrow screen after disallowing the gesture and allowing it', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ OC.allowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ viewport.set(480);
+
+ // Setting the viewport width does not automatically trigger a
+ // resize.
+ $(window).resize();
+
+ // The resize handler is debounced to be executed a few milliseconds
+ // after the resize event.
+ clock.tick(1000);
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ });
+ it('is enabled when allowing the gesture after disallowing it and resizing to a narrow screen', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ viewport.set(480);
+
+ // Setting the viewport width does not automatically trigger a
+ // resize.
+ $(window).resize();
+
+ // The resize handler is debounced to be executed a few milliseconds
+ // after the resize event.
+ clock.tick(1000);
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ OC.allowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ });
+ it('is disabled when disallowing the gesture after disallowing it, resizing to a narrow screen and allowing it', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ viewport.set(480);
+
+ // Setting the viewport width does not automatically trigger a
+ // resize.
+ $(window).resize();
+
+ // The resize handler is debounced to be executed a few milliseconds
+ // after the resize event.
+ clock.tick(1000);
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ OC.allowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledTwice).toBe(true);
+ expect(snapperStub.disable.getCall(1).calledWithExactly(true)).toBe(true);
+ });
+ it('is disabled when resizing to a wide screen', function() {
+ viewport.set(480);
+
+ window.initCore();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.called).toBe(false);
+ expect(snapperStub.close.called).toBe(false);
+
+ viewport.set(1280);
+
+ // Setting the viewport width does not automatically trigger a
+ // resize.
+ $(window).resize();
+
+ // The resize handler is debounced to be executed a few milliseconds
+ // after the resize event.
+ clock.tick(1000);
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+ });
+ it('is not disabled again when disallowing the gesture after resizing to a wide screen', function() {
+ viewport.set(480);
+
+ window.initCore();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.called).toBe(false);
+ expect(snapperStub.close.called).toBe(false);
+
+ viewport.set(1280);
+
+ // Setting the viewport width does not automatically trigger a
+ // resize.
+ $(window).resize();
+
+ // The resize handler is debounced to be executed a few milliseconds
+ // after the resize event.
+ clock.tick(1000);
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.calledOnce).toBe(true);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+ });
+ it('is not enabled when allowing the gesture after disallowing it, resizing to a narrow screen and resizing to a wide screen', function() {
+ viewport.set(1280);
+
+ window.initCore();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+
+ OC.disallowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+
+ viewport.set(480);
+
+ // Setting the viewport width does not automatically trigger a
+ // resize.
+ $(window).resize();
+
+ // The resize handler is debounced to be executed a few milliseconds
+ // after the resize event.
+ clock.tick(1000);
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledOnce).toBe(true);
+ expect(snapperStub.close.calledOnce).toBe(true);
+
+ viewport.set(1280);
+
+ $(window).resize();
+
+ clock.tick(1000);
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledTwice).toBe(true);
+ expect(snapperStub.close.calledTwice).toBe(true);
+
+ OC.allowNavigationBarSlideGesture();
+
+ expect(snapperStub.enable.called).toBe(false);
+ expect(snapperStub.disable.calledTwice).toBe(true);
+ expect(snapperStub.close.calledTwice).toBe(true);
+ });
+ });
});
diff --git a/core/vendor/core.js b/core/vendor/core.js
index bda270892ad..e573ef10642 100644
--- a/core/vendor/core.js
+++ b/core/vendor/core.js
@@ -6704,9 +6704,13 @@ dav.Client.prototype = {
/**
* Disables Snap.js events
+ * @param {Boolean} endCurrentDrag Whether to end the current drag (if any) or not.
*/
- disable: function() {
+ disable: function(endCurrentDrag) {
utils.dispatchEvent('disable');
+ if (endCurrentDrag) {
+ this.action.drag.endDrag();
+ }
this.action.drag.stopListening();
},
diff --git a/core/vendor/snapjs/dist/latest/snap.js b/core/vendor/snapjs/dist/latest/snap.js
index a0274138de0..7ae088d0aea 100644
--- a/core/vendor/snapjs/dist/latest/snap.js
+++ b/core/vendor/snapjs/dist/latest/snap.js
@@ -744,9 +744,13 @@
/**
* Disables Snap.js events
+ * @param {Boolean} endCurrentDrag Whether to end the current drag (if any) or not.
*/
- disable: function() {
+ disable: function(endCurrentDrag) {
utils.dispatchEvent('disable');
+ if (endCurrentDrag) {
+ this.action.drag.endDrag();
+ }
this.action.drag.stopListening();
},
diff --git a/issue_template.md b/issue_template.md
index ecf2f62ea68..e614ea0aed0 100644
--- a/issue_template.md
+++ b/issue_template.md
@@ -7,6 +7,10 @@ For reporting potential security issues please see https://nextcloud.com/securit
To make it possible for us to help you please fill out below information carefully.
You can also use the Issue Template application to prefill most of the required information: https://apps.nextcloud.com/apps/issuetemplate
+
+If you are a customer, please submit your issue directly in the Nextcloud Portal https://portal.nextcloud.com so it gets resolved more quickly by our dedicated engineers.
+
+Note that Nextcloud is an open source project backed by Nextcloud GmbH. Most of our volunteers are home users and thus primarily care about issues that affect home users. Our paid engineers prioritize issues of our customers. If you are neither a home user nor a customer, consider paying somebody to fix your issue, do it yourself or become a customer.
-->
### Steps to reproduce
1.
diff --git a/tests/karma.config.js b/tests/karma.config.js
index fb613857e91..0254d6a3335 100644
--- a/tests/karma.config.js
+++ b/tests/karma.config.js
@@ -237,7 +237,7 @@ module.exports = function(config) {
basePath: '..',
// frameworks to use
- frameworks: ['jasmine', 'jasmine-sinon'],
+ frameworks: ['jasmine', 'jasmine-sinon', 'viewport'],
// list of files / patterns to load in the browser
files: files,