Skip to content

Commit f70e097

Browse files
committed
- add config api
- add `suppress` option - bump version
1 parent 8edf463 commit f70e097

File tree

7 files changed

+7140
-3401
lines changed

7 files changed

+7140
-3401
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Logs
22

3+
## v0.0.11
4+
5+
- add `config` api
6+
- add `suppress` option
7+
8+
39
## v0.0.10
410

511
- add a close button

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Constructor options:
2929

3030
- `host`: host element ( should be an input element, if provided )
3131
- `time`: default true. hide and disable time picker if false.
32+
- `suppress`: default false. suppress popup when clicking host if true.
3233
- `fixed`: (deprecated) default false. true to enabled fixed mode.
3334
- `mode`: either `in-place`, `out-place` or `fixed`.
3435
- `fixed`:
@@ -58,6 +59,8 @@ Constructor options:
5859
- `on(n, cb)`
5960
- `update()`
6061
- `value()`
62+
- `config(opt)`: update configuration. following options are supported:
63+
- `suppress`: see constructor option for this option.
6164

6265

6366
## License

dist/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
var ref$, _c, div, r, x$, _handler, e, this$ = this;
66
opt == null && (opt = {});
77
this.opt = opt;
8+
this._suppress = opt.suppress;
89
this._enabled = {
910
time: !(opt.time != null) || opt.time
1011
};
@@ -67,7 +68,9 @@
6768
? document.querySelector(opt.host)
6869
: opt.host;
6970
this.host.addEventListener('mouseup', function(evt){
70-
return this$.toggle();
71+
if (!this$._suppress) {
72+
return this$.toggle();
73+
}
7174
});
7275
}
7376
div.innerHTML = html;
@@ -384,6 +387,10 @@
384387
this._last = this.cur;
385388
this.sel = this.cur = v;
386389
return this.update();
390+
},
391+
config: function(cfg){
392+
cfg == null && (cfg = {});
393+
return this._suppress = cfg.suppress;
387394
}
388395
});
389396
if (typeof module != 'undefined' && module !== null) {

dist/index.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)