* [html5] fix style scanning in uglified code bundle.

Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/26646cf3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/26646cf3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/26646cf3

Branch: refs/heads/dev
Commit: 26646cf383399a3b035786636087d079bdd3ef4b
Parents: 214c6e3
Author: MrRaindrop <tekk...@gmail.com>
Authored: Tue Aug 22 14:17:52 2017 +0800
Committer: MrRaindrop <tekk...@gmail.com>
Committed: Tue Aug 22 14:17:52 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/style.js | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/26646cf3/html5/render/vue/mixins/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/style.js b/html5/render/vue/mixins/style.js
index 647119d..ba11ed5 100644
--- a/html5/render/vue/mixins/style.js
+++ b/html5/render/vue/mixins/style.js
@@ -67,16 +67,14 @@ function getIdentifiedBeforeCreate () {
       for (; thisHookIdx < len; thisHookIdx++) {
         if (hooks[thisHookIdx]._styleMixin) { break }
       }
-      for (let i = thisHookIdx + 1; i < len; i++) {
-        const func = hooks[i]
-        if (func.name === 'injectStyle') {
-          hooks[i] = function () {
-            // call the original injectStyle hook.
-            func.call(this)
-            // scan the new appended styleSheet.
-            extend(weex._styleMap, getHeadStyleMap())
-            hooks[i] = func
-          }
+      if (thisHookIdx !== len - 1) {
+        const func = hooks[len - 1]
+        hooks[len - 1] = function () {
+          // call the original injectStyle hook.
+          func.call(this)
+          // scan the new appended styleSheet.
+          extend(weex._styleMap, getHeadStyleMap())
+          hooks[len - 1] = func
         }
       }
     }

Reply via email to