diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/js/files/client.js | 7 | ||||
-rw-r--r-- | core/src/Polyfill/closest.js | 19 | ||||
-rw-r--r-- | core/src/Polyfill/index.js | 3 | ||||
-rw-r--r-- | core/src/main.js | 4 | ||||
-rw-r--r-- | core/src/views/Login.vue | 2 |
5 files changed, 31 insertions, 4 deletions
diff --git a/core/js/files/client.js b/core/js/files/client.js index 98874d165bf..0daf7c9dc3f 100644 --- a/core/js/files/client.js +++ b/core/js/files/client.js @@ -323,6 +323,13 @@ data.isEncrypted = false; } + var isFavouritedProp = props['{' + Client.NS_OWNCLOUD + '}favorite']; + if (!_.isUndefined(isFavouritedProp)) { + data.isFavourited = isFavouritedProp === '1'; + } else { + data.isFavourited = false; + } + var contentType = props[Client.PROPERTY_GETCONTENTTYPE]; if (!_.isUndefined(contentType)) { data.mimetype = contentType; diff --git a/core/src/Polyfill/closest.js b/core/src/Polyfill/closest.js new file mode 100644 index 00000000000..1c608646127 --- /dev/null +++ b/core/src/Polyfill/closest.js @@ -0,0 +1,19 @@ +// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill + +if (!Element.prototype.matches) { + Element.prototype.matches + = Element.prototype.msMatchesSelector + || Element.prototype.webkitMatchesSelector +} + +if (!Element.prototype.closest) { + Element.prototype.closest = function(s) { + var el = this + + do { + if (el.matches(s)) return el + el = el.parentElement || el.parentNode + } while (el !== null && el.nodeType === 1) + return null + } +} diff --git a/core/src/Polyfill/index.js b/core/src/Polyfill/index.js index 055ab6343a4..306c72a0777 100644 --- a/core/src/Polyfill/index.js +++ b/core/src/Polyfill/index.js @@ -1,4 +1,4 @@ -/* +/** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> * * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -20,4 +20,5 @@ */ import './console' +import './closest' import './windows-phone' diff --git a/core/src/main.js b/core/src/main.js index 29c657f5db3..3f0e82df95f 100644 --- a/core/src/main.js +++ b/core/src/main.js @@ -1,4 +1,4 @@ -/* +/** * @copyright 2018 Christoph Wurst <christoph@winzerhof-wurst.at> * * @author 2018 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -20,8 +20,8 @@ */ import $ from 'jquery' -import '@babel/polyfill' import './Polyfill/index' +import '@babel/polyfill' // If you remove the line below, tests won't pass // eslint-disable-next-line no-unused-vars diff --git a/core/src/views/Login.vue b/core/src/views/Login.vue index 08538ec2fe9..c7958aac15b 100644 --- a/core/src/views/Login.vue +++ b/core/src/views/Login.vue @@ -27,7 +27,7 @@ <LoginForm :username.sync="user" :redirect-url="redirectUrl" - :directLogin="directLogin" + :direct-login="directLogin" :messages="messages" :errors="errors" :throttle-delay="throttleDelay" |