Merge pull request #4871 from owncloud/add_exists_method_to_jquery
add exists method to jquery
This commit is contained in:
commit
2e79aab0ce
1 changed files with 10 additions and 1 deletions
|
@ -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();
|
||||
|
@ -921,6 +921,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
|
||||
|
|
Loading…
Reference in a new issue