Skip to content

Commit

Permalink
Merge pull request #5711 from adobe/rlim/skip-unneeded-redraw
Browse files Browse the repository at this point in the history
No redrawing of the same image if it is already open.
  • Loading branch information
couzteau committed Oct 26, 2013
2 parents 4df69da + f86b99f commit 8b1cd0a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/editor/EditorManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,10 @@ define(function (require, exports, module) {
* @param {!string} fullPath path to the file displayed in the custom view
*/
function showCustomViewer(provider, fullPath) {
var $customView = provider.getCustomViewHolder(fullPath);

if (_currentlyViewedPath === fullPath) {
return;
}

DocumentManager._clearCurrentDocument();

// Hide the not-editor
Expand All @@ -654,7 +656,7 @@ define(function (require, exports, module) {
_removeCustomViewer();

_nullifyEditor();
_$currentCustomViewer = $customView;
_$currentCustomViewer = provider.getCustomViewHolder(fullPath);
// place in window
$("#editor-holder").append(_$currentCustomViewer);

Expand Down

0 comments on commit 8b1cd0a

Please sign in to comment.