Make window and WCF available to WCF.Template
authorTim Düsterhus <timwolla@googlemail.com>
Mon, 24 Jun 2013 13:49:20 +0000 (16:49 +0300)
committerTim Düsterhus <timwolla@googlemail.com>
Mon, 24 Jun 2013 13:49:20 +0000 (16:49 +0300)
wcfsetup/install/files/js/WCF.js

index d2100995ca9c5956011d56701db970d17b2d2e58..9afb7d5a999c839df36d729ee88c06a833f91a1a 100755 (executable)
@@ -3903,7 +3903,7 @@ WCF.Template = Class.extend({
                template = "$output += '" + template + "';";
                
                try {
-                       this.fetch = new Function("v", "var $output = ''; " + template + ' return $output;');
+                       this.fetch = new Function("v", "if (typeof v != 'object') { v = {}; } v.__window = window; v.__wcf = window.WCF; var $output = ''; " + template + ' return $output;');
                }
                catch (e) {
                        console.debug("var $output = ''; " + template + ' return $output;');