mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-18 23:50:23 +00:00
fix(angular-bootstrap): fix boostrap scripts that broke w\ 5a2dcb9a
Commit 5a2dcb9a doesn't properly modify angular-boostrap.js. This fix resolves issues and makes both the regular and scenario version of angular-boostrap.js functional.
This commit is contained in:
parent
95fdb1231f
commit
84873e7f4e
2 changed files with 12 additions and 5 deletions
14
src/angular-bootstrap.js
vendored
14
src/angular-bootstrap.js
vendored
|
|
@ -5,14 +5,22 @@
|
|||
* (c) 2010-2011 AngularJS http://angularjs.org
|
||||
* License: MIT
|
||||
*/
|
||||
(function(window) {
|
||||
(function(window, document) {
|
||||
|
||||
var filename = /^(.*\/)angular-bootstrap.js(#.*)?$/,
|
||||
scripts = document.getElementsByTagName("SCRIPT"),
|
||||
autobind = scripts[scripts.length-1].getAttribute('ng:autobind'),
|
||||
config,
|
||||
serverPath,
|
||||
match,
|
||||
globalVars = {};
|
||||
|
||||
if (autobind) {
|
||||
config = {autobind: autobind};
|
||||
} else {
|
||||
config = (autobind == '') ? {autobind: true} : {}
|
||||
}
|
||||
|
||||
for(var j = 0; j < scripts.length; j++) {
|
||||
match = (scripts[j].src || "").match(filename);
|
||||
if (match) {
|
||||
|
|
@ -99,7 +107,7 @@
|
|||
// empty the cache to prevent mem leaks
|
||||
globalVars = {};
|
||||
|
||||
angularInit({autobind:true}, document);
|
||||
angularInit(config, document);
|
||||
}
|
||||
|
||||
if (window.addEventListener) {
|
||||
|
|
@ -108,5 +116,5 @@
|
|||
window.attachEvent('onload', onLoadListener);
|
||||
}
|
||||
|
||||
})(window);
|
||||
})(window, document);
|
||||
|
||||
|
|
|
|||
3
src/scenario/angular-bootstrap.js
vendored
3
src/scenario/angular-bootstrap.js
vendored
|
|
@ -25,8 +25,7 @@
|
|||
try {
|
||||
if (previousOnLoad) previousOnLoad();
|
||||
} catch(e) {}
|
||||
var config = angularJsConfig(document);
|
||||
if (config.autotest) angular.scenario.setUpAndRun(config);
|
||||
angular.scenario.setUpAndRun({});
|
||||
};
|
||||
|
||||
addCSS("../../css/angular-scenario.css");
|
||||
|
|
|
|||
Loading…
Reference in a new issue