diff options
author | Bernhard Posselt <Raydiation@users.noreply.github.com> | 2013-09-17 06:07:50 -0700 |
---|---|---|
committer | Bernhard Posselt <Raydiation@users.noreply.github.com> | 2013-09-17 06:07:50 -0700 |
commit | 2e79aab0ce7ec9fa88ccbafd01e82574b93514f9 (patch) | |
tree | 39f416be4272ff66ad9e7112e40317e4e3b0eef7 /core | |
parent | 9d18e16c77e8c2690dd23dd19ca1f8e1968161c8 (diff) | |
parent | afe4f6a79489ba5eafcea74cac27e336932a5dca (diff) | |
download | nextcloud-server-2e79aab0ce7ec9fa88ccbafd01e82574b93514f9.tar.gz nextcloud-server-2e79aab0ce7ec9fa88ccbafd01e82574b93514f9.zip |
Merge pull request #4871 from owncloud/add_exists_method_to_jquery
add exists method to jquery
Diffstat (limited to 'core')
-rw-r--r-- | core/js/js.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js index c09f80369f9..cb7287c02ae 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -906,7 +906,7 @@ OC.set=function(name, value) { * @param {type} start * @param {type} end */ -$.fn.selectRange = function(start, end) { +jQuery.fn.selectRange = function(start, end) { return this.each(function() { if (this.setSelectionRange) { this.focus(); @@ -922,6 +922,15 @@ $.fn.selectRange = function(start, end) { }; /** + * check if an element exists. + * allows you to write if ($('#myid').exists()) to increase readability + * @link http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery + */ +jQuery.fn.exists = function(){ + return this.length > 0; +} + +/** * Calls the server periodically every 15 mins to ensure that session doesnt * time out */ |