diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index c3ac046..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index 48a2e24..2f7cf27 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ components build +.DS_Store diff --git a/bower.json b/bower.json index 590fd79..e1f6533 100644 --- a/bower.json +++ b/bower.json @@ -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 " diff --git a/component.json b/component.json index ed4fb92..d811764 100644 --- a/component.json +++ b/component.json @@ -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": {}, diff --git a/index.js b/index.js index 60c003d..369f301 100644 --- a/index.js +++ b/index.js @@ -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; diff --git a/package.json b/package.json index 5301841..a4af471 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test/build.js b/test/build.js index 866fb2b..0918455 100644 --- a/test/build.js +++ b/test/build.js @@ -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\