浏览代码

Changed the qooxdoo pre template back to the way it was.

tags/0.5.2
wittemann 14 年前
父节点
当前提交
53e49cfc76
共有 1 个文件被更改,包括 7 次插入12 次删除
  1. +7
    -12
      mustache-qooxdoo/qooxdoo.mustache.js.tpl.pre

+ 7
- 12
mustache-qooxdoo/qooxdoo.mustache.js.tpl.pre 查看文件

@@ -97,7 +97,8 @@ qx.Class.define("qx.bom.Template", {
* Helper method which provides you with a direct access to templates
* stored as HTML in the DOM. The DOM node with the given ID will be reated
* as a template, parsed and a new DOM node will be returned containing the
* parsed data.
* parsed data. Keep in mind to have only one root DOM element in the the
* template.
*
* @param id {String} The id of the HTML template in the DOM.
* @param view {Object} The object holding the data to render.
@@ -108,26 +109,20 @@ qx.Class.define("qx.bom.Template", {
// get the content stored in the DOM
var template = document.getElementById(id);
var inner = template.innerHTML;
// apply the view
inner = this.toHtml(inner, view, partials);
// special case for text only conversion
if (inner.search(/<|>/) === -1) {
return inner;
}
// create a helper to convert the string into DOM nodes
var helper = qx.bom.Element.create("div");
helper.innerHTML = inner;
// use a document fragment to return more than one note
var docFragment = document.createDocumentFragment();
for (var i = helper.childNodes.length - 1; i >= 0; i--) {
qx.dom.Element.insertBegin(helper.childNodes[i], docFragment);
};
return docFragment;

return helper.children[0];
}
}
});


正在加载...
取消
保存