[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6085] trunk/UI



Revision: 6085
          http://sourceforge.net/p/ledger-smb/code/6085
Author:   einhverfr
Date:     2013-09-26 10:23:30 +0000 (Thu, 26 Sep 2013)
Log Message:
-----------
Created new general tabset widget for LedgerSMB (will be of use more generally later
Also fixed a bug that the move to our extended DateTextBox created.

Modified Paths:
--------------
    trunk/UI/Contact/contact.js
    trunk/UI/lib/setup.js

Modified: trunk/UI/Contact/contact.js
===================================================================
--- trunk/UI/Contact/contact.js	2013-09-26 04:04:15 UTC (rev 6084)
+++ trunk/UI/Contact/contact.js	2013-09-26 10:23:30 UTC (rev 6085)
@@ -1,24 +1,13 @@
 require([
          'dojo/query', 
          'dojo/dom', 
-         "dijit/layout/TabContainer",
+         "lsmb/lib/TabSet",
          "dijit/layout/ContentPane",
          'lsmb/Contact/tabs',
           'dijit/registry',
          'dojo/ready'],
        function(query, dom, tc, cp, obj, registry){
            var tabs = new tc({}, dom.byId('contact_tabs'));
-           query('div.lsmbtab').forEach(function(cnode){
-               new cp (
-                   { "data-dojo-type": 'dijit.layout.ContentPane',
-                     "title": cnode.title},
-                   cnode 
-               );
-               var t = registry.byId(cnode.id);
-               if (t !== undefined){
-                   tabs.addChild(t);
-               }
-           });
            tabs.startup();
            obj.init();
        } 

Modified: trunk/UI/lib/setup.js
===================================================================
--- trunk/UI/lib/setup.js	2013-09-26 04:04:15 UTC (rev 6084)
+++ trunk/UI/lib/setup.js	2013-09-26 10:23:30 UTC (rev 6085)
@@ -1,5 +1,6 @@
-/* construct_form_node(query, cls, textbox, checkbox, datebox, radio, select,
- *                     button, input)
+/* construct_form_node(query, cls, registry,
+ *                     textbox, checkbox, radio, select, button, textarea,
+ *                     input)
  * This constructs the appropriate dojo/dijit object from the input provided and
  * returns it to the calling function.  query and cls are needed for select box
  * and textbox class detection.  input is the node.  The others are appropriate
@@ -7,8 +8,8 @@
  */
 
 function construct_form_node(query, cls, registry,
-                        textbox, checkbox, datebox, radio, select, button, 
-                        textarea, input)
+                        textbox, checkbox, radio, select, button, textarea, 
+                        input)
 {
     
     if (input.nodeName == 'INPUT'){ 
@@ -159,7 +160,6 @@
               'dojox/layout/TableContainer',
               'dijit/form/TextBox',
               'dijit/form/CheckBox',
-              'dijit/form/DateTextBox',
               'dijit/form/RadioButton',
               'dijit/form/Select',
               'dijit/form/Button',
@@ -167,10 +167,18 @@
               'dijit/form/Textarea',
               'dojo/domReady!'
              ],
-      function(query, registry, cls, construct, table, textbox, checkbox, datebox, 
+      function(query, registry, cls, construct, table, textbox, checkbox, 
                radio, select, button, textarea, contentpane)
       {
              lsmbConfig.dateformat = lsmbConfig.dateformat.replace('m', 'M');
+             var parse = false;
+             query('#dojo-declarative').forEach(function() { parse = true; });
+             if (parse){
+                 return require(['dojo/parser', 'dojo/domReady!'],
+                        function(parser){
+                            return parser.parse();
+                        });
+             }
              query('.tabular').forEach(
                   function(node){
                       var tabparams = {
@@ -211,11 +219,12 @@
                                  }
                              }
                              var widget = registry.byNode(input);
-                             if (widget == undefined){
+                             if (widget == undefined && input !== undefined){
  
                                  widget = construct_form_node(
-                                               query, cls, registry, textbox, checkbox, 
-                                               datebox, radio, select,
+                                               query, cls, registry, 
+                                               textbox, checkbox, 
+                                               radio, select,
                                                button, textarea, input
                                  );
                              }
@@ -250,7 +259,7 @@
                       }
                       var widget = construct_form_node(
                                            query, cls, registry, textbox, checkbox, 
-                                           datebox, radio, select,
+                                           radio, select,
                                            button, textarea, node
                       );
                       if (! try_startup(widget)){

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits