@lrnwebcomponents/fullscreen-behaviors
Advanced tools
Comparing version 2.7.7 to 2.7.10
@@ -21,3 +21,3 @@ /** | ||
return { | ||
...super.properties | ||
...super.properties, | ||
}; | ||
@@ -52,3 +52,3 @@ } | ||
} | ||
` | ||
`, | ||
]; | ||
@@ -63,3 +63,3 @@ } | ||
?disabled="${!this.fullscreenEnabled}" | ||
@click="${e => this.toggleFullscreen()}" | ||
@click="${(e) => this.toggleFullscreen()}" | ||
> | ||
@@ -66,0 +66,0 @@ Toggle Fullscreen |
@@ -8,3 +8,3 @@ /** | ||
const FullscreenBehaviors = function(SuperClass) { | ||
const FullscreenBehaviors = function (SuperClass) { | ||
return class extends SuperClass { | ||
@@ -15,3 +15,3 @@ // properties available to the custom element for data binding | ||
__fullscreen: { type: Boolean, attribute: "fullscreen" }, | ||
__fullscreenEnabled: { type: Boolean, attribute: "fullscreen-enabled" } | ||
__fullscreenEnabled: { type: Boolean, attribute: "fullscreen-enabled" }, | ||
}; | ||
@@ -21,5 +21,3 @@ } | ||
render() { | ||
return html` | ||
<slot></slot> | ||
`; | ||
return html` <slot></slot> `; | ||
} | ||
@@ -90,6 +88,5 @@ | ||
this.fullscreenManager && this.fullscreenManager.enabled; | ||
if (screenfull && screenfull.isEnabled) | ||
screenfull.on("change", () => { | ||
this._updateFullscreen(); | ||
}); | ||
if (screenfull && screenfull.isEnabled) { | ||
screenfull.on("change", this._updateFullscreen.bind(this)); | ||
} | ||
} | ||
@@ -96,0 +93,0 @@ |
@@ -23,3 +23,3 @@ /** | ||
__callbacks: { type: Array }, | ||
__fullscreen: { type: Boolean } | ||
__fullscreen: { type: Boolean }, | ||
}; | ||
@@ -84,3 +84,3 @@ } | ||
this.__loaded = true; | ||
(this.__callbacks || []).forEach(callback => callback()); | ||
(this.__callbacks || []).forEach((callback) => callback()); | ||
} | ||
@@ -87,0 +87,0 @@ } |
@@ -6,3 +6,3 @@ /*! | ||
*/ | ||
(function() { | ||
(function () { | ||
"use strict"; | ||
@@ -16,3 +16,3 @@ | ||
var fn = (function() { | ||
var fn = (function () { | ||
var val; | ||
@@ -27,3 +27,3 @@ | ||
"fullscreenchange", | ||
"fullscreenerror" | ||
"fullscreenerror", | ||
], | ||
@@ -37,3 +37,3 @@ // New WebKit | ||
"webkitfullscreenchange", | ||
"webkitfullscreenerror" | ||
"webkitfullscreenerror", | ||
], | ||
@@ -47,3 +47,3 @@ // Old WebKit | ||
"webkitfullscreenchange", | ||
"webkitfullscreenerror" | ||
"webkitfullscreenerror", | ||
], | ||
@@ -56,3 +56,3 @@ [ | ||
"mozfullscreenchange", | ||
"mozfullscreenerror" | ||
"mozfullscreenerror", | ||
], | ||
@@ -65,4 +65,4 @@ [ | ||
"MSFullscreenChange", | ||
"MSFullscreenError" | ||
] | ||
"MSFullscreenError", | ||
], | ||
]; | ||
@@ -89,10 +89,10 @@ | ||
change: fn.fullscreenchange, | ||
error: fn.fullscreenerror | ||
error: fn.fullscreenerror, | ||
}; | ||
var screenfull = { | ||
request: function(element) { | ||
request: function (element) { | ||
return new Promise( | ||
function(resolve, reject) { | ||
var onFullScreenEntered = function() { | ||
function (resolve, reject) { | ||
var onFullScreenEntered = function () { | ||
this.off("change", onFullScreenEntered); | ||
@@ -114,5 +114,5 @@ resolve(); | ||
}, | ||
exit: function() { | ||
exit: function () { | ||
return new Promise( | ||
function(resolve, reject) { | ||
function (resolve, reject) { | ||
if (!this.isFullscreen) { | ||
@@ -123,3 +123,3 @@ resolve(); | ||
var onFullScreenExit = function() { | ||
var onFullScreenExit = function () { | ||
this.off("change", onFullScreenExit); | ||
@@ -139,24 +139,24 @@ resolve(); | ||
}, | ||
toggle: function(element) { | ||
toggle: function (element) { | ||
return this.isFullscreen ? this.exit() : this.request(element); | ||
}, | ||
onchange: function(callback) { | ||
onchange: function (callback) { | ||
this.on("change", callback); | ||
}, | ||
onerror: function(callback) { | ||
onerror: function (callback) { | ||
this.on("error", callback); | ||
}, | ||
on: function(event, callback) { | ||
on: function (event, callback) { | ||
var eventName = eventNameMap[event]; | ||
if (eventName) { | ||
document.addEventListener(eventName, callback, false); | ||
window.addEventListener(eventName, callback, false); | ||
} | ||
}, | ||
off: function(event, callback) { | ||
off: function (event, callback) { | ||
var eventName = eventNameMap[event]; | ||
if (eventName) { | ||
document.removeEventListener(eventName, callback, false); | ||
window.removeEventListener(eventName, callback, false); | ||
} | ||
}, | ||
raw: fn | ||
raw: fn, | ||
}; | ||
@@ -176,19 +176,19 @@ | ||
isFullscreen: { | ||
get: function() { | ||
get: function () { | ||
return Boolean(document[fn.fullscreenElement]); | ||
} | ||
}, | ||
}, | ||
element: { | ||
enumerable: true, | ||
get: function() { | ||
get: function () { | ||
return document[fn.fullscreenElement]; | ||
} | ||
}, | ||
}, | ||
isEnabled: { | ||
enumerable: true, | ||
get: function() { | ||
get: function () { | ||
// Coerce to boolean in case of old WebKit | ||
return Boolean(document[fn.fullscreenEnabled]); | ||
} | ||
} | ||
}, | ||
}, | ||
}); | ||
@@ -195,0 +195,0 @@ |
@@ -30,6 +30,6 @@ { | ||
"devDependencies": { | ||
"grunt": "^1.0.4", | ||
"grunt": "1.3.0", | ||
"grunt-contrib-concat": "^1.0.1", | ||
"grunt-contrib-copy": "^1.0.0", | ||
"grunt-contrib-uglify": "^4.0.1", | ||
"grunt-contrib-uglify": "5.0.0", | ||
"load-grunt-tasks": "^4.0.0", | ||
@@ -36,0 +36,0 @@ "tsd": "^0.7.1", |
@@ -15,3 +15,3 @@ { | ||
}, | ||
"version": "2.7.7", | ||
"version": "2.7.10", | ||
"description": "Provides state management when only one child can be selected at a time.", | ||
@@ -27,9 +27,9 @@ "repository": { | ||
"scripts": { | ||
"test": "../../node_modules/.bin/wct --configFile ../../wct.conf.json node_modules/@lrnwebcomponents/fullscreen-behaviors/test/", | ||
"test": "wct --configFile ../../wct.conf.json node_modules/@lrnwebcomponents/fullscreen-behaviors/test/", | ||
"start": "yarn run dev", | ||
"build": "../../node_modules/.bin/gulp --gulpfile=gulpfile.cjs && ../../node_modules/.bin/rollup -c && ../../node_modules/.bin/prettier --ignore-path ../../.prettierignore --write '**/*.{js,json}' && wca analyze \"**/*.js\" --format vscode --outFile vscode-html-custom-data.json", | ||
"dev": "../../node_modules/.bin/concurrently --kill-others \"yarn run watch\" \"yarn run serve\"", | ||
"watch": "../../node_modules/.bin/gulp dev --gulpfile=gulpfile.cjs", | ||
"serve": "../../node_modules/.bin/es-dev-server -c ../../es-dev-server.config.js", | ||
"lighthouse": "../../node_modules/.bin/gulp lighthouse --gulpfile=gulpfile.cjs" | ||
"build": "gulp --gulpfile=gulpfile.cjs && rollup -c && prettier --ignore-path ../../.prettierignore --write \"**/*.{js,json}\" && wca analyze \"**/*.js\" --format vscode --outFile vscode-html-custom-data.json", | ||
"dev": "concurrently --kill-others \"yarn run watch\" \"yarn run serve\"", | ||
"watch": "gulp dev --gulpfile=gulpfile.cjs", | ||
"serve": "es-dev-server -c ../../es-dev-server.config.js", | ||
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs" | ||
}, | ||
@@ -41,15 +41,15 @@ "author": { | ||
"dependencies": { | ||
"@lrnwebcomponents/es-global-bridge": "^2.7.7", | ||
"@lrnwebcomponents/es-global-bridge": "^2.7.10", | ||
"@polymer/polymer": "^3.3.1", | ||
"lit-element": "^2.3.1" | ||
"lit-element": "2.4.0" | ||
}, | ||
"devDependencies": { | ||
"@lrnwebcomponents/deduping-fix": "^2.7.7", | ||
"@lrnwebcomponents/simple-modal": "^2.7.7", | ||
"@lrnwebcomponents/storybook-utilities": "^2.7.7", | ||
"@lrnwebcomponents/simple-modal": "^2.7.10", | ||
"@lrnwebcomponents/storybook-utilities": "^2.7.10", | ||
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page", | ||
"@polymer/iron-demo-helpers": "3.1.0", | ||
"@rhelements/rh-sass": "1.0.0-prerelease.7", | ||
"@webcomponents/webcomponentsjs": "2.4.1", | ||
"concurrently": "5.1.0", | ||
"@webcomponents/webcomponentsjs": "2.4.4", | ||
"concurrently": "5.3.0", | ||
"gulp-babel": "8.0.0", | ||
@@ -70,3 +70,3 @@ "lodash": "4.17.19", | ||
], | ||
"gitHead": "5b346a23a41445900c73e9b8748be86b6f7db550" | ||
"gitHead": "5b8d225cec2bf64160b4f4cab0630b187fdcd2d8" | ||
} |
@@ -8,3 +8,3 @@ /** | ||
const FullscreenBehaviors = function(SuperClass) { | ||
const FullscreenBehaviors = function (SuperClass) { | ||
return class extends SuperClass { | ||
@@ -15,3 +15,3 @@ // properties available to the custom element for data binding | ||
__fullscreen: { type: Boolean, attribute: "fullscreen" }, | ||
__fullscreenEnabled: { type: Boolean, attribute: "fullscreen-enabled" } | ||
__fullscreenEnabled: { type: Boolean, attribute: "fullscreen-enabled" }, | ||
}; | ||
@@ -21,5 +21,3 @@ } | ||
render() { | ||
return html` | ||
<slot></slot> | ||
`; | ||
return html` <slot></slot> `; | ||
} | ||
@@ -90,6 +88,5 @@ | ||
this.fullscreenManager && this.fullscreenManager.enabled; | ||
if (screenfull && screenfull.isEnabled) | ||
screenfull.on("change", () => { | ||
this._updateFullscreen(); | ||
}); | ||
if (screenfull && screenfull.isEnabled) { | ||
screenfull.on("change", this._updateFullscreen.bind(this)); | ||
} | ||
} | ||
@@ -96,0 +93,0 @@ |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
86725
26
1838
2
+ Addedlit-element@2.4.0(transitive)
- Removedlit-element@2.5.1(transitive)
Updatedlit-element@2.4.0