Permalink
Browse files

Minor cleanups, and fix a bug introduced in the last change that caus…

…es private thumbnails not to show up
  • Loading branch information...
bharat committed Aug 22, 2010
1 parent bea5f67 commit 88efbd77b45ae888b035295a8034229c645267c2
@@ -38,7 +38,7 @@ package org.gallery3.api {
import mx.rpc.events.FaultEvent;
import mx.utils.ArrayUtil;
import mx.utils.ObjectUtil;
use namespace flash_proxy;
[Event(name="collectionChange", type="mx.events.CollectionEvent")]
@@ -194,8 +194,8 @@ package org.gallery3.api {
req.requestHeaders = [
new URLRequestHeader("Accept", "*/*"),
new URLRequestHeader("Cache-Control", "no-cache"),
new URLRequestHeader(GalleryRestRequest::X_GALLERY_REQUEST_METHOD, "GET"),
new URLRequestHeader(GalleryRestRequest::X_GALLERY_REQUEST_KEY, GalleryRestRequest.accessKey)
new URLRequestHeader(GalleryRestRequest.METHOD_HEADER, "GET"),
new URLRequestHeader(GalleryRestRequest.KEY_HEADER, GalleryRestRequest.accessKey)
];
var url:URL = new URL(thumbUrl);
var size:String = url.getParamValue("size");
@@ -52,8 +52,8 @@ package org.gallery3.api {
"405": "Method Not Allowed",
"500": "Internal Server Error"
}
public static const METHOD_HEADER: String = "X-Gallery-Request-Method";
public static const KEY_HEADER: String = "X-Gallery-Request-Key";
public static const METHOD_HEADER: String = "X-Gallery-Request-Method";
public static const KEY_HEADER: String = "X-Gallery-Request-Key";
private static const MULTIPART_BOUNDARY: String = "----------196f00b77b968397849367c61a2080";
private static const MULTIPART_MARK: String = "--";
private static const LF: String = "\r\n";
@@ -66,8 +66,6 @@ package org.gallery3.organize {
public var imageGrid: ThumbGrid;
public var sortColumn: ComboBox;
public var sortDirection: ComboBox;
public var rotateCCW: Button;
public var rotateCW: Button;
public var addAlbum: Button;
public var addImages: Button;
public var deleteImages: Button;
@@ -140,12 +138,14 @@ package org.gallery3.organize {
},
function (fault: Object): void {
ErrorDialog.display(fault as Fault);
}));
})
);
imageGrid.addEventListener("ThumbGridItemsDropped", function(event: Event): void {
setSortColumn("weight");
});
});
}
protected function albumsUpdated(event: Event): void {
if (openPath.length > 0) {
for each (var item: GalleryAlbum in event.target) {
@@ -295,7 +295,7 @@ package org.gallery3.organize {
if (newCount != _selectedCount) {
var album: GalleryAlbum = albumTree.selectedItem as GalleryAlbum;
_selectedCount = newCount;
rotateCW.enabled = rotateCCW.enabled = deleteImages.enabled = _selectedCount > 0 && album.canEdit;
deleteImages.enabled = _selectedCount > 0 && album.canEdit;
}
}
@@ -86,7 +86,7 @@ package org.gallery3.organize.components {
} else {
var item:IListItemRenderer = mouseEventToItemRenderer(event);
if (item != _lastHighlightItemRendererAtIndices && _lastHighlightItemRendererAtIndices) {
_updateHightlight(_lastHighlightItemRendererAtIndices, _lastHighlightItemIndices, false);
_updateHighlight(_lastHighlightItemRendererAtIndices, _lastHighlightItemIndices, false);
}
}
}
@@ -113,7 +113,7 @@ package org.gallery3.organize.components {
drawItem(UIDToItemRenderer(uid), isItemSelected(item.data), true, uid == caretUID);
var pt:Point = itemRendererToIndices(item);
if (pt) { // during tweens, we may get null
_updateHightlight(item, pt, true);
_updateHighlight(item, pt, true);
}
}
}
@@ -131,11 +131,11 @@ package org.gallery3.organize.components {
override protected function dragExitHandler(event:DragEvent): void {
if (_lastHighlightItemRendererAtIndices) {
_updateHightlight(_lastHighlightItemRendererAtIndices, _lastHighlightItemIndices, false);
_updateHighlight(_lastHighlightItemRendererAtIndices, _lastHighlightItemIndices, false);
}
}
private function _updateHightlight(item:IListItemRenderer, pt:Point, showHighlight:Boolean): void {
private function _updateHighlight(item:IListItemRenderer, pt:Point, showHighlight:Boolean): void {
var uid:String = itemToUID(item.data);
drawItem(UIDToItemRenderer(uid), isItemSelected(item.data), showHighlight, uid == caretUID);
var evt:ListEvent = new ListEvent(showHighlight? ListEvent.ITEM_ROLL_OVER : ListEvent.ITEM_ROLL_OUT);

0 comments on commit 88efbd7

Please sign in to comment.