diff options
author | Sam Potts <sam@potts.es> | 2018-08-01 00:58:27 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-08-01 00:58:27 +1000 |
commit | 58079393e6463c0a72666aa974de92cb17f72fc2 (patch) | |
tree | 1d911d2abebec86f8b3fc089600c6234b076a983 /dist/plyr.js | |
parent | 0b44f2d897e9ef644de40871018c1cfd7b1496e5 (diff) | |
download | plyr-58079393e6463c0a72666aa974de92cb17f72fc2.tar.lz plyr-58079393e6463c0a72666aa974de92cb17f72fc2.tar.xz plyr-58079393e6463c0a72666aa974de92cb17f72fc2.zip |
Build
Diffstat (limited to 'dist/plyr.js')
-rw-r--r-- | dist/plyr.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/dist/plyr.js b/dist/plyr.js index f66f7bda..20d94a02 100644 --- a/dist/plyr.js +++ b/dist/plyr.js @@ -2558,11 +2558,6 @@ typeof navigator === "object" && (function (global, factory) { create: function create(data) { var _this9 = this; - // Do nothing if we want no controls - if (is.empty(this.config.controls)) { - return null; - } - // Create the container var container = createElement('div', getAttributesFromSelector(this.config.selectors.controls.wrapper)); @@ -2850,13 +2845,19 @@ typeof navigator === "object" && (function (global, factory) { }; var update = true; - if (is.string(this.config.controls) || is.element(this.config.controls)) { - // String or HTMLElement passed as the option + // If function, run it and use output + if (is.function(this.config.controls)) { + this.config.controls = this.config.controls.call(this.props); + } + + // Convert falsy controls to empty array (primarily for empty strings) + if (!this.config.controls) { + this.config.controls = []; + } + + if (is.element(this.config.controls) || is.string(this.config.controls)) { + // HTMLElement or Non-empty string passed as the option container = this.config.controls; - } else if (is.function(this.config.controls)) { - // A custom function to build controls - // The function can return a HTMLElement or String - container = this.config.controls.call(this, props); } else { // Create controls container = controls.create.call(this, { |