]> source.dussan.org Git - nextcloud-server.git/commitdiff
Shorten optional text-argument processing
authorkondou <kondou@ts.unde.re>
Wed, 25 Sep 2013 15:19:38 +0000 (17:19 +0200)
committerkondou <kondou@ts.unde.re>
Wed, 25 Sep 2013 15:19:38 +0000 (17:19 +0200)
core/js/placeholder.js

index 3c7b11ef468eaa27d56dd5a8df5526a7e8a541b0..ee2a8ce84c42b1fa0996abe6fc82fbc3492d8d5a 100644 (file)
@@ -48,9 +48,8 @@
 
 (function ($) {
        $.fn.placeholder = function(seed, text) {
-               if (typeof(text) === "undefined") {
-                       text = seed;
-               }
+               // set optional argument "text" to value of "seed" if undefined
+               text = text || seed;
 
                var hash = md5(seed),
                        maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16),