]> source.dussan.org Git - nextcloud-server.git/commitdiff
use underscore.js for undefined checks
authorArthur Schiwon <blizzz@owncloud.com>
Wed, 29 Oct 2014 18:20:32 +0000 (19:20 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Thu, 20 Nov 2014 17:31:40 +0000 (18:31 +0100)
apps/user_ldap/js/settings.js

index be1db28648fb326338d10cd00e9b1b7a79e2b51b..f6fcaa2849ed871db9f505766ceb17d07b3def43 100644 (file)
@@ -151,7 +151,7 @@ var LdapWizard = {
        ajaxRequests: {},
 
        ajax: function(param, fnOnSuccess, fnOnError, reqID) {
-               if(typeof reqID !== 'undefined') {
+               if(!_.isUndefined(reqID)) {
                        if(LdapWizard.ajaxRequests.hasOwnProperty(reqID)) {
                                console.log('aborting ' + reqID);
                                console.log(param);
@@ -169,7 +169,7 @@ var LdapWizard = {
                                }
                        }
                );
-               if(typeof reqID !== 'undefined') {
+               if(!_.isUndefined(reqID)) {
                        LdapWizard.ajaxRequests[reqID] = request;
                }
                return request;
@@ -354,14 +354,14 @@ var LdapWizard = {
                        function(result) {
                                LdapWizard.applyChanges(result);
                                LdapWizard.hideSpinner(spinnerID);
-                               if(doneCallback !== undefined) {
+                               if(!_.isUndefined(doneCallback)) {
                                        doneCallback(method);
                                }
                        },
                        function (result) {
                                OC.Notification.show('Counting the entries failed with, ' + result.message);
                                LdapWizard.hideSpinner(spinnerID);
-                               if(doneCallback !== undefined) {
+                               if(!_.isUndefined(doneCallback)) {
                                        doneCallback(method);
                                }
                        },