Skip to content

Commit

Permalink
Merge @pabloz-globant's enhancement.
Browse files Browse the repository at this point in the history
  • Loading branch information
squat committed Apr 26, 2014
2 parents 684883f + 3079e96 commit 7dade5e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
components
build
.DS_Store
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "postpone",
"main": "index.js",
"version": "0.6.1",
"version": "0.6.2",
"homepage": "https://github.com/lsvx/postpone",
"authors": [
"Lucas Serven <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "postpone",
"repo": "lsvx/postpone",
"description": "A polyfill for postponing the loading of media.",
"version": "0.6.1",
"version": "0.6.2",
"keywords": ["postpone", "media", "resource", "priority", "download"],
"dependencies": {},
"development": {},
Expand Down
15 changes: 9 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,18 @@
}
}

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

/**
* This is necessary to make Safari (and, apparently, old versions of Chrome)
* re-render the new content; see:
* stackoverflow.com/questions/11245385/object-works-in-every-browser-except-google-chrome
* This is necessary to make Safari 7 refresh the object's new content.
*/
el.innerHTML = el.innerHTML;
var activeElement = document.activeElement;
el.focus();

if ( activeElement ) {
activeElement.focus();
}
}

return el;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postpone",
"version": "0.6.1",
"version": "0.6.2",
"description": "A polyfill for postponing the loading of media.",
"main": "index.js",
"directories": {
Expand Down
15 changes: 9 additions & 6 deletions test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,15 +638,18 @@ require.register("postpone/index.js", Function("exports, require, module",
}\n\
}\n\
\n\
else if ( el.tagName.toLowerCase() === \"object\" && el.getAttribute( \"data-data\" )) {\n\
el.setAttribute( \"data\", el.getAttribute( \"data-data\" ));\n\
else if ( el.tagName.toLowerCase() === \"object\" && el.getAttribute( \"data-data\" ) ) {\n\
el.setAttribute( \"data\", el.getAttribute( \"data-data\" ) );\n\
\n\
/**\n\
* This is necessary to make Safari (and, apparently, old versions of Chrome)\n\
* re-render the new content; see:\n\
* stackoverflow.com/questions/11245385/object-works-in-every-browser-except-google-chrome\n\
* This is necessary to make Safari 7 refresh the object's new content.\n\
*/\n\
el.innerHTML = el.innerHTML;\n\
var activeElement = document.activeElement;\n\
el.focus();\n\
\n\
if ( activeElement ) {\n\
activeElement.focus();\n\
}\n\
}\n\
\n\
return el;\n\
Expand Down

0 comments on commit 7dade5e

Please sign in to comment.