Commit 49c19035 authored by dbeam's avatar dbeam Committed by Commit bot

extensions: don't animate options dialog when loading.

Transitions are disabled while loading, so animations should be as well.

This happens when chrome://extensions/?options=<id> is navigated to,
which shows the dialog immediately.

R=kalman@chromium.org
BUG=none
TEST=load chrome://extensions/?options=<extension_id> and look for
     needless animation

Review URL: https://codereview.chromium.org/896283003

Cr-Commit-Position: refs/heads/master@{#314649}
parent 55b3eab0
...@@ -131,9 +131,10 @@ cr.define('extensions', function() { ...@@ -131,9 +131,10 @@ cr.define('extensions', function() {
// the overlay. It is calculated by multiplying the pythagorean distance // the overlay. It is calculated by multiplying the pythagorean distance
// between old and the new size (in px) with a constant speed of // between old and the new size (in px) with a constant speed of
// 0.25 ms/px. // 0.25 ms/px.
var animationTime = 0.25 * Math.sqrt( var loading = document.documentElement.classlist.contains('loading');
Math.pow(newWidth - oldWidth, 2) + var animationTime = loading ? 0 :
Math.pow(newHeight - oldHeight, 2)); 0.25 * Math.sqrt(Math.pow(newWidth - oldWidth, 2) +
Math.pow(newHeight - oldHeight, 2));
if (animation) if (animation)
animation.cancel(); animation.cancel();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment