Skip to content

Commit 7dade5e

Browse files
committed
Merge @pabloz-globant's enhancement.
2 parents 684883f + 3079e96 commit 7dade5e

File tree

7 files changed

+22
-15
lines changed

7 files changed

+22
-15
lines changed

.DS_Store

-6 KB
Binary file not shown.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
components
22
build
3+
.DS_Store

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "postpone",
33
"main": "index.js",
4-
"version": "0.6.1",
4+
"version": "0.6.2",
55
"homepage": "https://github.com/lsvx/postpone",
66
"authors": [
77
"Lucas Serven <lserven@gmail.com>"

component.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "postpone",
33
"repo": "lsvx/postpone",
44
"description": "A polyfill for postponing the loading of media.",
5-
"version": "0.6.1",
5+
"version": "0.6.2",
66
"keywords": ["postpone", "media", "resource", "priority", "download"],
77
"dependencies": {},
88
"development": {},

index.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,18 @@
436436
}
437437
}
438438

439-
else if ( el.tagName.toLowerCase() === "object" && el.getAttribute( "data-data" )) {
440-
el.setAttribute( "data", el.getAttribute( "data-data" ));
439+
else if ( el.tagName.toLowerCase() === "object" && el.getAttribute( "data-data" ) ) {
440+
el.setAttribute( "data", el.getAttribute( "data-data" ) );
441441

442442
/**
443-
* This is necessary to make Safari (and, apparently, old versions of Chrome)
444-
* re-render the new content; see:
445-
* stackoverflow.com/questions/11245385/object-works-in-every-browser-except-google-chrome
443+
* This is necessary to make Safari 7 refresh the object's new content.
446444
*/
447-
el.innerHTML = el.innerHTML;
445+
var activeElement = document.activeElement;
446+
el.focus();
447+
448+
if ( activeElement ) {
449+
activeElement.focus();
450+
}
448451
}
449452

450453
return el;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postpone",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"description": "A polyfill for postponing the loading of media.",
55
"main": "index.js",
66
"directories": {

test/build.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -638,15 +638,18 @@ require.register("postpone/index.js", Function("exports, require, module",
638638
}\n\
639639
}\n\
640640
\n\
641-
else if ( el.tagName.toLowerCase() === \"object\" && el.getAttribute( \"data-data\" )) {\n\
642-
el.setAttribute( \"data\", el.getAttribute( \"data-data\" ));\n\
641+
else if ( el.tagName.toLowerCase() === \"object\" && el.getAttribute( \"data-data\" ) ) {\n\
642+
el.setAttribute( \"data\", el.getAttribute( \"data-data\" ) );\n\
643643
\n\
644644
/**\n\
645-
* This is necessary to make Safari (and, apparently, old versions of Chrome)\n\
646-
* re-render the new content; see:\n\
647-
* stackoverflow.com/questions/11245385/object-works-in-every-browser-except-google-chrome\n\
645+
* This is necessary to make Safari 7 refresh the object's new content.\n\
648646
*/\n\
649-
el.innerHTML = el.innerHTML;\n\
647+
var activeElement = document.activeElement;\n\
648+
el.focus();\n\
649+
\n\
650+
if ( activeElement ) {\n\
651+
activeElement.focus();\n\
652+
}\n\
650653
}\n\
651654
\n\
652655
return el;\n\

0 commit comments

Comments
 (0)