Skip to content

Commit

Permalink
window.location and document.location should be the same object
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcher committed Aug 13, 2010
1 parent 788bb02 commit c5cbb1d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.properties
Expand Up @@ -2,7 +2,7 @@
PROJECT: env-js
BUILD_MAJOR: 1
BUILD_MINOR: 2
BUILD_ID: 25
BUILD_ID: 26
BUILD_VERSION: ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}
BUILD: ${PROJECT}.${BUILD_VERSION}
VERSION: ${BUILD} ${DSTAMP}
Expand Down
16 changes: 6 additions & 10 deletions src/window/window.js
Expand Up @@ -160,16 +160,12 @@ Window = function(scope, parent, opener){
get location(){
return $location;
},
set location(uri){
uri = Envjs.uri(uri);
//new Window(this, this.parent, this.opener);
if($location.href == uri){
$location.reload();
}else if($location.href == 'about:blank'){
$location.assign(uri);
}else{
$location.replace(uri);
}
set location(url){
//very important or you will go into an infinite
//loop when creating a xml document
if(url) {
$location.assign(Envjs.uri(url));
}
},
get name(){
return $name;
Expand Down
6 changes: 2 additions & 4 deletions src/xhr/document.js
Expand Up @@ -13,13 +13,11 @@ __extend__(Document.prototype,{
}
},
get location(){
return new Location(this.documentURI, this);
return this.ownerWindow.location;
},
set location(url){
//very important or you will go into an infinite
//loop when creating a xml document
if(url) {
this.location.replace(url);
}
this.ownerWindow.location = url;
}
});

0 comments on commit c5cbb1d

Please sign in to comment.