@@ -25,126 +25,3 @@ function initSortableSettings(coCreateMapAutocomplete) {
2525}
2626
2727
28-
29-
30- // jin
31-
32- // const CoCreateInit = {
33- // modules: {},
34- // newModules: {},
35- // observer: null,
36-
37- // /**
38- // * key: module name
39- // * instance: module instance (ex, CoCreateInput or window)
40- // * initFunc: function instance for init
41- // */
42- // register : function (key, instance, initFunc) {
43- // if (this.modules[key]) {
44- // return;
45- // }
46- // this.modules[key] = {
47- // func: initFunc,
48- // instance: instance
49- // }
50- // },
51-
52- // init: function() {
53- // if (this.observer) {
54- // return ;
55- // }
56- // try {
57- // const self = this;
58- // this.observer = new MutationObserver(function(mutations) {
59- // self.mutationLogic(mutations)
60- // });
61- // const config = { attribute:false, childList: true, characterData: false, subtree: true };
62- // this.observer.observe(document.body, config);
63- // } catch (error) {
64-
65- // }
66- // },
67-
68- // registerModules : function (key, instance, initFunc) {
69- // if (this.newModules[key]) {
70- // return;
71- // }
72- // this.newModules[key] = {
73- // func: initFunc,
74- // instance: instance
75- // }
76- // },
77-
78- // runInit: function(container) {
79- // console.log(this.newModules, container)
80- // for (let [key, value] of Object.entries(this.newModules)) {
81- // value['func'].call(value['instance'], container);
82- // }
83- // },
84-
85- // mutationLogic: function(mutations) {
86- // const self = this;
87- // console.log('mutations event.....');
88- // mutations.forEach(function(mutation){
89- // if (mutation.type == "childList" && mutation.addedNodes.length == 1) {
90- // const addedNode = mutation.addedNodes.item(0);
91- // if (!self.modules) {
92- // return;
93- // }
94-
95- // if (!addedNode.querySelectorAll || !addedNode.getAttribute) {
96- // return;
97- // }
98-
99- // for (let [key, value] of Object.entries(self.modules)) {
100- // value['func'].call(value['instance'], addedNode);
101- // // let items = addedNode.querySelectorAll(value['selector']);
102- // // items.forEach(el => {
103- // // console.log('init element with observer', key);
104- // // value['func'].call(value['instance'], el);
105- // // })
106- // }
107- // }
108- // });
109- // },
110- // }
111-
112- // CoCreateInit.init();
113-
114-
115-
116- // //jean
117- // const CoCreateInit = {
118- // register : function (selector = '',functionInit) {
119- // console.log("Observer")
120- // let observer = null;
121- // try{
122- // observer = new MutationObserver(function(mutations){
123- // mutations.forEach(function(mutation){
124- // if (mutation.type == "childList"
125- // && mutation.addedNodes.length == 1) {
126- // var addedNode = mutation.addedNodes.item(0);
127- // console.log(addedNode)
128- // var list = [];
129- // try{
130- // console.log(selector)
131- // list = addedNode.querySelectorAll(selector);
132- // }catch (error) {
133- // console.log(error);
134- // }
135- // list.forEach(elem=>{
136- // console.log("Init Element with Observer ",elem)
137- // functionInit(elem);
138- // });
139- // }
140- // });
141- // });
142- // var config = { attribute:false, childList: true, characterData: false, subtree: true };
143- // observer.observe(document.body, config);
144- // }catch (error) {
145- // console.error('errObserver')
146- // }
147- // return observer;
148- // }
149-
150- // }
0 commit comments