Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1301)

Unified Diff: chrome/browser/resources/file_manager/js/photo/slide_mode.js

Issue 10919292: Photo Editor: better mode transitions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/js/photo/slide_mode.js
diff --git a/chrome/browser/resources/file_manager/js/photo/slide_mode.js b/chrome/browser/resources/file_manager/js/photo/slide_mode.js
index 4ae8a3f0f794160360d5b6af7f82036156f4e516..3ac715c886e59beb7481b6c1a0d97b5cada3dc20 100644
--- a/chrome/browser/resources/file_manager/js/photo/slide_mode.js
+++ b/chrome/browser/resources/file_manager/js/photo/slide_mode.js
@@ -281,7 +281,7 @@ SlideMode.prototype.enter = function(
* Leave the mode.
* @param {Rect} zoomToRect Rectangle for zoom effect.
* @param {function} callback Called when the image is committed and
- * the zoom-out animation is done.
+ * the zoom-out animation has started.
*/
SlideMode.prototype.leave = function(zoomToRect, callback) {
if (this.prefetchTimer_) {
@@ -293,7 +293,6 @@ SlideMode.prototype.leave = function(zoomToRect, callback) {
this.stopEditing_();
this.stopSlideshow_();
ImageUtil.setAttribute(this.arrowBox_, 'active', false);
- this.unloadImage_(zoomToRect);
this.selectionModel_.removeEventListener(
'change', this.onSelectionBound_);
this.dataModel_.removeEventListener('splice', this.onSpliceBound_);
@@ -301,10 +300,8 @@ SlideMode.prototype.leave = function(zoomToRect, callback) {
this.active_ = false;
if (this.savedSelection_)
this.selectionModel_.selectedIndexes = this.savedSelection_;
- if (zoomToRect)
- setTimeout(callback, ImageView.ANIMATION_WAIT_INTERVAL);
- else
- callback();
+ this.unloadImage_(zoomToRect);
+ callback();
}.bind(this);
if (this.getItemCount_() == 0) {
@@ -356,6 +353,16 @@ SlideMode.prototype.getSelectedIndex = function() {
};
/**
+ * @return {Rect} Screen rectangle of the selected image.
+ */
+SlideMode.prototype.getSelectedImageRect = function() {
+ if (this.getSelectedIndex() < 0)
dgozman 2012/09/14 15:17:38 No selection in slide mode?
Vladislav Kaznacheev 2012/09/14 16:20:04 It is possible if there is 0 items. On 2012/09/14
+ return null;
+ else
+ return this.viewport_.getScreenClipped();
+};
+
+/**
* @return {Gallery.Item} Selected item
*/
SlideMode.prototype.getSelectedItem = function() {

Powered by Google App Engine
This is Rietveld 408576698