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 years ago
parent
commit
a0362620b0
1 changed files with 3 additions and 0 deletions
  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");