Author: sevein
Date: Fri Apr  6 13:05:31 2012
New Revision: 11415

Log:
Issue 2288, new treeview, some js code

Modified:
   branches/2.0/js/dominion.js

Modified: branches/2.0/js/dominion.js
==============================================================================
--- branches/2.0/js/dominion.js Fri Apr  6 13:04:55 2012        (r11414)
+++ branches/2.0/js/dominion.js Fri Apr  6 13:05:31 2012        (r11415)
@@ -194,7 +194,7 @@
       var data = $this.data('autocomplete');
       if (!data)
       {
-        $this.data('autocomplete', (data = new Autocomplete(this)));
+        $this.data('autocomplete', new Autocomplete(this));
       }
     };
 
@@ -222,12 +222,66 @@
    ****
    ****/
 
+  var Treeview = function (element)
+    {
+      this.$element = element;
+      this.init();
+    };
+
+  Treeview.prototype = {
+
+    constructor: Treeview,
+
+    init: function()
+      {
+
+        this.$element.find('li')
+          .hover(
+            $.proxy(this.mouseenter, this),
+            $.proxy(this.mouseleave, this))
+          .click(
+            $.proxy(this.click, this));
+
+      },
+
+    mouseenter: function (e)
+      {
+        $(e.target).addClass('hover');
+      },
+
+    mouseleave: function (e)
+      {
+        $(e.target).removeClass('hover');
+      },
+
+    click: function(e)
+      {
+        e.preventDefault();
+
+
+      }
+
+  };
+
+  $.fn.treeview = function()
+    {
+      var $this = this;
+      var data = $this.data('treeview');
+      if (!data)
+      {
+        $this.data('treeview', new Treeview(this));
+      }
+    };
+
+  $.fn.treeview.Constructor = Treeview;
+
   $(function ()
     {
-      $('body').on('click', '#treeview li a', function(e)
-        {
-          console.log("a");
-        });
+      var $treeview = $('body.sfRadPlugin.index #treeview');
+      if (0 < $treeview.length)
+      {
+        $treeview.treeview();
+      }
     });
 
 }(window.jQuery);

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to