screenfull
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "screenfull", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Simple wrapper for cross-browser usage of the JavaScript Fullscreen API, which lets you bring the page or any element into fullscreen.", | ||
@@ -24,5 +24,5 @@ "license": "MIT", | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt-contrib-concat": "^0.5.0", | ||
"grunt-contrib-uglify": "^0.10.1", | ||
"grunt": "^1.0.1", | ||
"grunt-contrib-concat": "^1.0.0", | ||
"grunt-contrib-uglify": "^2.0.0", | ||
"load-grunt-tasks": "^3.3.0", | ||
@@ -29,0 +29,0 @@ "xo": "*" |
@@ -5,5 +5,9 @@ # screenfull.js | ||
- | ||
<p align="center"><b>🔥 Want to strengthen your core JavaScript skills and master ES6?</b><br>I would personally recommend this awesome <a href="https://ES6.io/friend/AWESOME" title="Sponsored link, but excellent regardless">ES6 course</a> by Wes Bos.</p> | ||
- | ||
### [Demo](http://sindresorhus.com/screenfull.js) | ||
### [Demo](https://sindresorhus.com/screenfull.js) | ||
### [Check out my other projects](https://github.com/sindresorhus?tab=repositories) | ||
@@ -77,3 +81,3 @@ | ||
```js | ||
document.getElementById('button').addEventListener('click', function () { | ||
document.getElementById('button').addEventListener('click', () => { | ||
if (screenfull.enabled) { | ||
@@ -91,4 +95,5 @@ screenfull.request(); | ||
```js | ||
var elem = document.getElementById('target'); | ||
document.getElementById('button').addEventListener('click', function () { | ||
const elem = document.getElementById('target'); | ||
document.getElementById('button').addEventListener('click', () => { | ||
if (screenfull.enabled) { | ||
@@ -104,4 +109,5 @@ screenfull.request(elem); | ||
```js | ||
var target = $('#target')[0]; // Get DOM element from jQuery collection | ||
$('#button').click(function () { | ||
const target = $('#target')[0]; // Get DOM element from jQuery collection | ||
$('#button').on('click', () => { | ||
if (screenfull.enabled) { | ||
@@ -117,6 +123,5 @@ screenfull.request(target); | ||
```js | ||
$('img').click(function () { | ||
$('img').on('click', event => { | ||
if (screenfull.enabled) { | ||
// We can use `this` since we want the clicked element | ||
screenfull.toggle(this); | ||
screenfull.toggle(event.target); | ||
} | ||
@@ -131,3 +136,3 @@ }); | ||
if (screenfull.enabled) { | ||
document.addEventListener(screenfull.raw.fullscreenchange, function () { | ||
document.addEventListener(screenfull.raw.fullscreenchange, () => { | ||
console.log('Am I fullscreen? ' + (screenfull.isFullscreen ? 'Yes' : 'No')); | ||
@@ -142,3 +147,3 @@ }); | ||
if (screenfull.enabled) { | ||
document.addEventListener(screenfull.raw.fullscreenerror, function (event) { | ||
document.addEventListener(screenfull.raw.fullscreenerror, event => { | ||
console.error('Failed to enable fullscreen', event); | ||
@@ -149,3 +154,3 @@ }); | ||
See the [demo](http://sindresorhus.com/screenfull.js) for more examples, and view the source. | ||
See the [demo](https://sindresorhus.com/screenfull.js) for more examples, and view the source. | ||
@@ -203,3 +208,3 @@ #### Fullscreen an element with Angular.js | ||
```js | ||
$(document).on(screenfull.raw.fullscreenchange, function () { | ||
$(document).on(screenfull.raw.fullscreenchange, () => { | ||
console.log('Fullscreen change'); | ||
@@ -217,4 +222,4 @@ }); | ||
```js | ||
$('#new-page-btn').click(function () { | ||
var iframe = document.createElement('iframe') | ||
$('#new-page-btn').click(() => { | ||
const iframe = document.createElement('iframe') | ||
@@ -248,2 +253,2 @@ iframe.setAttribute('id', 'external-iframe'); | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10956
244