summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-09-16 13:47:37 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-09-16 13:47:37 +0200
commitafe4f6a79489ba5eafcea74cac27e336932a5dca (patch)
tree9c8a664413dd02eeb1c896f435f5508bfe21db95 /core
parent46f59b165e5bd1908509e8a62b67bf983cfd6224 (diff)
downloadnextcloud-server-afe4f6a79489ba5eafcea74cac27e336932a5dca.tar.gz
nextcloud-server-afe4f6a79489ba5eafcea74cac27e336932a5dca.zip
add exists method to jquery
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js11
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
*/