luci-base: luci.js: add L.bind() helper
authorJo-Philipp Wich <jo@mein.io>
Fri, 25 Jan 2019 07:19:36 +0000 (08:19 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 7 Jul 2019 13:25:49 +0000 (15:25 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/luci.js

index 949f730a224e9651c0fe23d5762610e54e2cd429..b02710bcb6aca8ecf185724c2c4f9d6a83771d82 100644 (file)
                        throw e;
                },
 
+               bind: function(fn, self /*, ... */) {
+                       return Function.prototype.bind.apply(fn, this.varargs(arguments, 2, self));
+               },
+
                /* Class require */
                require: function(name, from) {
                        var L = this, url = null, from = from || [];