Skip to content

Commit

Permalink
Tweak dist setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsor committed Sep 18, 2018
1 parent adb3079 commit dcca7e4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 361 deletions.
334 changes: 0 additions & 334 deletions dist/ctrly-es2015.js

This file was deleted.

11 changes: 7 additions & 4 deletions dist/ctrly-module.js → dist/ctrly.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ var defaultOptions = {
closeOnScroll: false,
trapFocus: false,
allowMultiple: false,
on: null
on: null,
autoInit: true
};
function settings(opts) {
var extended = {};
Expand Down Expand Up @@ -413,8 +414,8 @@ function ctrly() {
}));
}
if (options.closeOnBlur && !options.trapFocus) {
removeFuncs.push(on(target, 'focusout', function (e) {
if (!e.relatedTarget || !target.contains(e.relatedTarget)) {
removeFuncs.push(on(document, 'focusin', function (e) {
if (!target.contains(e.target)) {
close(target, false);
}
}, {
Expand Down Expand Up @@ -583,7 +584,9 @@ function ctrly() {
}
}
}
init();
if (options.autoInit) {
init();
}
return {
init: init,
destroy: destroy
Expand Down
11 changes: 7 additions & 4 deletions dist/ctrly.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@
closeOnScroll: false,
trapFocus: false,
allowMultiple: false,
on: null
on: null,
autoInit: true
};
function settings(opts) {
var extended = {};
Expand Down Expand Up @@ -419,8 +420,8 @@
}));
}
if (options.closeOnBlur && !options.trapFocus) {
removeFuncs.push(on(target, 'focusout', function (e) {
if (!e.relatedTarget || !target.contains(e.relatedTarget)) {
removeFuncs.push(on(document, 'focusin', function (e) {
if (!target.contains(e.target)) {
close(target, false);
}
}, {
Expand Down Expand Up @@ -589,7 +590,9 @@
}
}
}
init();
if (options.autoInit) {
init();
}
return {
init: init,
destroy: destroy
Expand Down
Loading

0 comments on commit dcca7e4

Please sign in to comment.