diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-11-29 12:51:37 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-12-08 10:29:51 +0100 |
commit | 2514176e41c19e27de7abaffc5f86995b7d683bb (patch) | |
tree | b5cf13a5d490c51df3a26eff286d6c8414d58eae /core/js/shareitemmodel.js | |
parent | 74d1b0bada1b291038c88cf1e289d6696c65bfb7 (diff) | |
download | nextcloud-server-2514176e41c19e27de7abaffc5f86995b7d683bb.tar.gz nextcloud-server-2514176e41c19e27de7abaffc5f86995b7d683bb.zip |
flicker-free permission change in share dialog
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'core/js/shareitemmodel.js')
-rw-r--r-- | core/js/shareitemmodel.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index a784f59f67f..4a2f8f8bc8a 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -391,6 +391,26 @@ return share.share_with_displayname; }, + /** + * returns the array index of a sharee for a provided shareId + * + * @param shareId + * @returns {number} + */ + findShareWithIndex: function(shareId) { + var shares = this.get('shares'); + if(!_.isArray(shares)) { + throw "Unknown Share"; + } + for(var i = 0; i < shares.length; i++) { + var shareWith = shares[i]; + if(shareWith['id'] == shareId) { + return i; + } + } + throw "Unknown Sharee"; + }, + getShareType: function(shareIndex) { /** @type OC.Share.Types.ShareInfo **/ var share = this.get('shares')[shareIndex]; |