editor_creator.js 514 B

123456789101112131415161718
  1. var EditorCreator = {
  2. convert: function (el, template, callback) {
  3. if (!el || !template || !$tom) return;
  4. $tom.applyStyles(el, {display: 'none'});
  5. Trex.I.XHRequester.sendRequest('get',
  6. template,
  7. '',
  8. false,
  9. function (html) {
  10. var root = document.createElement('div');
  11. root.innerHTML = html;
  12. $tom.insertNext(root, el);
  13. callback && callback();
  14. }
  15. );
  16. }
  17. };