@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizmann/pico-js",
3
- "version": "0.3.25",
3
+ "version": "0.3.26",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
@@ -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