Replace the final document.createElement with $.createDom
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 28 Dec 2011 22:51:45 +0000 (17:51 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 28 Dec 2011 22:51:45 +0000 (17:51 -0500)
web_frontend/file.js

index c6d431a3c707314cdafa19c10f939f567f12e2b7..6c8422b2887ca4e14de0da90b789e4eed08064d7 100644 (file)
@@ -95,11 +95,10 @@ armadillo.File.prototype.setHighlight = function(h) {
 armadillo.File.prototype.createDom = function() {
   // Create the element if it does not exist.  If it does, remove all children.
   if (!this.element_) {
-    this.element_ = document.createElement('li');
-    this.element_.representedObject = this;
+    this.element_ = $.createDom('li');
     var handler = (this.isSpecial_() ? this.clickHandler_ : this.actorHandler_);
   }
-  $(this.element_).empty();
+  this.element_.empty();
 
   // Set the name of the entry.
   this.title_ = $.createDom('div');
@@ -111,7 +110,7 @@ armadillo.File.prototype.createDom = function() {
   } else {
     this.title_.text(this.name_);
   }
-  $(this.element_).append(this.title_);
+  this.element_.append(this.title_);
   this.title_.click(handler.bind(this));
 
   return this.element_;
@@ -173,7 +172,7 @@ armadillo.File.prototype.actorHandler_ = function(e) {
   if (!this.actor_.getElement()) {
     var elm = this.actor_.createDom();
     elm.hide();
-    $(this.element_).append(elm);
+    this.element_.append(elm);
   }
   this.actor_.getElement().slideToggle('fast');
 };