]> git.wh0rd.org Git - tt-rss.git/commitdiff
@FIXED dijit modules aren't cached even all the js files are compressed
authorgitawego <gitawego@gmail.com>
Tue, 28 May 2013 20:40:17 +0000 (23:40 +0300)
committergitawego <gitawego@gmail.com>
Tue, 28 May 2013 20:40:17 +0000 (23:40 +0300)
@CHANGED use require to load all the dependencies
@FIXED dojo.parser isn't loaded in cached mode, it has to be loaded via require.

include/login_form.php

index 0637c453a6811ed4afa57dd4f2ed659295397bf8..b401fdac05142a3fea1cda7d42b2db7bff8b52a5 100644 (file)
@@ -6,12 +6,12 @@
        <link rel="shortcut icon" type="image/png" href="images/favicon.png">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <script type="text/javascript" src="lib/dojo/dojo.js"></script>
-       <script type="text/javascript" src="lib/dijit/dijit.js"></script>
        <script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script>
        <script type="text/javascript" src="lib/prototype.js"></script>
        <script type="text/javascript" src="js/functions.js"></script>
        <script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script>
        <script type="text/javascript">
+               require({cache:{}});
                Event.observe(window, 'load', function() {
                        init();
                });
 
 <script type="text/javascript">
 function init() {
-       dojo.require("dijit.form.Button");
-       dojo.require("dijit.form.CheckBox");
-       dojo.require("dijit.form.Form");
-       dojo.require("dijit.form.Select");
-       dojo.require("dijit.form.TextBox");
-       dojo.require("dijit.form.ValidationTextBox");
 
-       dojo.parser.parse();
+       require(['dojo/parser','dijit/form/Button','dijit/form/CheckBox','dijit/form/Form',
+       'dijit/form/Select','dijit/form/TextBox','dijit/form/ValidationTextBox'],function(parser){
+               parser.parse();
+               //show tooltip node only after this widget is instaniated. 
+               dojo.query('div[dojoType="dijit.Tooltip"]').style({
+                       display:''
+               });
+               fetchProfiles();
+               dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
+               document.forms.loginForm.login.focus();
+       });     
 
-       fetchProfiles();
-
-       dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
-
-       document.forms.loginForm.login.focus();
 }
 
 function fetchProfiles() {
@@ -217,7 +216,7 @@ function bwLimitChange(elem) {
                        <label id="bw_limit_label" style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
                </div>
 
-               <div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below">
+               <div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below" style="display:none">
 <?php echo __("Does not display images in articles, reduces automatic refreshes."); ?>
                </div>