Browse Source

Detect if amber is really included as bower package.

Recent change has broken deployments of amber,
where it is not deployed as a bower component,
but are still deployed at different place from the page itself
(like from assets server).

This attempts to detect (via '/bower_components/' in path)
whether to use newly patched or old behaviour.
Herbert Vojčík 10 năm trước cách đây
mục cha
commit
a0362620b0
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      support/amber.js

+ 3 - 0
support/amber.js

@@ -24,6 +24,9 @@ require = function (require) {
     // e.g. http://app.com/index.html -> http://app.com/
     var document_home = window.location.href.replace(/\/[^\/]+$/, "");
 
+    if (!amber_home.match(/\/bower_components\//)) {
+        document_home = amber_home;
+    }
 
     function resolveViaDOM(url) {
         var a = document.createElement("a");