@kizmann/pico-js 0.3.25 → 0.3.26
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/pico-js.js +1 -1
- package/dist/pico-js.js.map +1 -1
- package/package.json +1 -1
- package/src/library/element.js +9 -1
package/package.json
CHANGED
package/src/library/element.js
CHANGED
@@ -102,7 +102,7 @@ export class Element
|
|
102
102
|
/**
|
103
103
|
* Bind callback on selector.
|
104
104
|
*/
|
105
|
-
static observe(key)
|
105
|
+
static observe(key, plain = false)
|
106
106
|
{
|
107
107
|
let selector = this.getPrefix(key);
|
108
108
|
|
@@ -126,6 +126,10 @@ export class Element
|
|
126
126
|
Dom.find(el).attr(selector)
|
127
127
|
);
|
128
128
|
|
129
|
+
if ( plain && Any.isEmpty(options) ) {
|
130
|
+
options = { _plain: Dom.find(el).attr(selector) };
|
131
|
+
}
|
132
|
+
|
129
133
|
if ( document.body.contains(el) ) {
|
130
134
|
return;
|
131
135
|
}
|
@@ -139,6 +143,10 @@ export class Element
|
|
139
143
|
Dom.find(el).attr(selector)
|
140
144
|
);
|
141
145
|
|
146
|
+
if ( plain && Any.isEmpty(options) ) {
|
147
|
+
options = { _plain: Dom.find(el).attr(selector) };
|
148
|
+
}
|
149
|
+
|
142
150
|
this.bind(key, el, options);
|
143
151
|
});
|
144
152
|
|