Skip to content

Commit

Permalink
A better patch for ticket #1332.
Browse files Browse the repository at this point in the history
Create a javascript callback (setLocation) that is called whenever the
current album is changed.
  • Loading branch information
talmdal committed Sep 8, 2010
1 parent 031b216 commit 45e4d42
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
24 changes: 13 additions & 11 deletions Gallery3Organize/src/org/gallery3/organize/OrganizeDialog.as
Expand Up @@ -292,6 +292,18 @@ package org.gallery3.organize {
StringUtil.replace(title, char, chars[char]);
}
ExternalInterface.call("setTitle", title);

var path: String = "";
while (album.id != 1) {
if (path.length > 0) {
path = "/" + path;
}
path = (album.slug != null ? album.slug : "") + path;
album = albumTree.getParentItem(album) as GalleryAlbum;
}

ExternalInterface.call("setLocation", OrganizeParameters.instance.url + path);

}
}

Expand Down Expand Up @@ -321,17 +333,7 @@ package org.gallery3.organize {
}

public function onDialogClose(event:FlexEvent): void {
var album: GalleryAlbum = albumTree.selectedItem as GalleryAlbum;

var path: String = "";
while (album.id != 1) {
if (path.length > 0) {
path = "/" + path;
}
path = (album.slug != null ? album.slug : "") + path;
album = albumTree.getParentItem(album) as GalleryAlbum;
}
ExternalInterface.call("closeOrganizeDialog", OrganizeParameters.instance.url + path);
ExternalInterface.call("closeOrganizeDialog");
}

protected function onSortColumnChange(event:IndexChangeEvent): void {
Expand Down
Binary file modified Gallery3WebClient/bin-release/Gallery3WebClient.swf
Binary file not shown.
11 changes: 9 additions & 2 deletions Gallery3WebClient/html-template/index.template.html
Expand Up @@ -48,8 +48,15 @@

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
function closeOrganizeDialog(url) {
console.log("Closing: " + url);
var reloadLocation = null;
function closeOrganizeDialog() {
if (reloadLocation != null) {
console.log("Closing: " + reloadLocation);
}
}
function setLocation(url) {
console.log("setLocation: " + url);
reloadLocation = url;
}
function setTitle(title) {
// @todo remove the comment from the following line before a release build
Expand Down

0 comments on commit 45e4d42

Please sign in to comment.