Commit 3c14b6f7 authored by finnur@chromium.org's avatar finnur@chromium.org

Polish the new tab notification code a bit, as per request in last review (style changes).

BUG=88067
TEST=None, notifications should work as before.
Review URL: http://codereview.chromium.org/7623010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96542 0039d316-1c4b-4281-b951-d872f2087c98
parent 44c13de1
...@@ -171,18 +171,16 @@ if ('mode' in hashParams) { ...@@ -171,18 +171,16 @@ if ('mode' in hashParams) {
</div> </div>
<div id="apps-content"></div> <div id="apps-content"></div>
<div id="app-notification-bubble" class="notification-bubble"> <div id="app-notification-bubble" class="notification-bubble">
<img id="app-notification-close" src="chrome://theme/IDR_CLOSE_BAR" <img id="app-notification-close" src="chrome://theme/IDR_CLOSE_BAR">
class="app-notification-close">
<strong id="app-notification-title"></strong><br> <strong id="app-notification-title"></strong><br>
<span id="app-notification-message"></span><br><br> <span id="app-notification-message"></span><br><br>
<a id="app-notification-link"></a> <a id="app-notification-link"></a>
</div> </div>
<div id="arrow-contents" <div id="arrow-container" class="notification-bubble-closed">
class="arrow arrow-contents notification-bubble-closed"></div> <div id="arrow-contents" class="arrow"></div>
<div id="arrow-border" <div id="arrow-border" class="arrow"></div>
class="arrow arrow-border notification-bubble-closed"></div> <div id="arrow-shadow" class="arrow"></div>
<div id="arrow-shadow" </div>
class="arrow arrow-shadow notification-bubble-closed"></div>
</div> </div>
<div class="maxiview" id="most-visited-maxiview"></div> <div class="maxiview" id="most-visited-maxiview"></div>
......
...@@ -107,7 +107,7 @@ enough extra space in the small grid layout. ...@@ -107,7 +107,7 @@ enough extra space in the small grid layout.
color: Blue; color: Blue;
} }
.app-notification-close { #app-notification-close {
height: 14px; height: 14px;
position: absolute; position: absolute;
right: 6px; right: 6px;
...@@ -223,7 +223,6 @@ html[dir=rtl] .app.web-store-entry.loner { ...@@ -223,7 +223,6 @@ html[dir=rtl] .app.web-store-entry.loner {
font-family: Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
font-size : 107%; font-size : 107%;
min-height: 100px; min-height: 100px;
min-width: 200px;
opacity: 0; opacity: 0;
padding: 10px; padding: 10px;
position: absolute; position: absolute;
...@@ -245,26 +244,35 @@ html[dir=rtl] .app.web-store-entry.loner { ...@@ -245,26 +244,35 @@ html[dir=rtl] .app.web-store-entry.loner {
pointer-events: none; pointer-events: none;
} }
/* A content-less div with this setting, will create an arrow when coupled div#arrow-container {
with the arrow_* styles below it. */ position: absolute;
-webkit-transition: opacity 0.2s linear;
}
/* The following arrow class (div.arrow) creates a triangle when used in
conjunction with the next three div styles below it (arrow-contents,
shadow and border). The border-color property determines which direction
the arrow is facing. */
div.arrow { div.arrow {
border-style: solid; border-style: solid;
border-width: 12px; border-width: 12px;
height: 0px; height: 0;
width: 0px; width: 0;
position: absolute;
} }
div.arrow-contents { div#arrow-contents {
border-color: transparent white transparent transparent; border-color: transparent white transparent transparent;
padding-left: 3px;
position: absolute;
z-index: 2; z-index: 2;
-webkit-transition: opacity 0.2s linear;
} }
div.arrow-shadow { div#arrow-shadow {
border-color: transparent gray transparent transparent; border-color: transparent #B5B5B5 transparent transparent;
-webkit-transition: opacity 0.2s linear; opacity: 0.5;
padding-left: 1px;
position: absolute;
} }
div.arrow-border { div#arrow-border {
border-color: transparent #B5B5B5 transparent transparent; border-color: transparent #B5B5B5 transparent transparent;
padding-left: 2px;
position: absolute;
z-index: 1; z-index: 1;
-webkit-transition: opacity 0.2s linear;
} }
...@@ -192,29 +192,17 @@ function showNotificationBubble(event) { ...@@ -192,29 +192,17 @@ function showNotificationBubble(event) {
bubble.style.top = y + "px"; bubble.style.top = y + "px";
// Move the arrow and shadow to the right location. // Move the arrow and shadow to the right location.
var arrow = $('arrow-contents'); var arrow_container = $('arrow-container');
var border = $('arrow-border');
var shadow = $('arrow-shadow');
y += 26; y += 26;
x -= arrow.style.width + 23; x -= arrow_container.style.width + 25;
arrow.style.left = x + "px"; arrow_container.style.left = x + "px";
arrow.style.top = y + "px"; arrow_container.style.top = y + "px";
x -= 1;
border.style.left = x + "px";
border.style.top = y + "px";
x -= 1;
shadow.style.left = x + "px";
shadow.style.top = y + "px";
// Animate the bubble into view. // Animate the bubble into view.
bubble.classList.add("notification-bubble-opened"); bubble.classList.add("notification-bubble-opened");
bubble.classList.remove("notification-bubble-closed"); bubble.classList.remove("notification-bubble-closed");
arrow.classList.add("notification-bubble-opened"); arrow_container.classList.add("notification-bubble-opened");
arrow.classList.remove("notification-bubble-closed"); arrow_container.classList.remove("notification-bubble-closed");
border.classList.add("notification-bubble-opened");
border.classList.remove("notification-bubble-closed");
shadow.classList.add("notification-bubble-opened");
shadow.classList.remove("notification-bubble-closed");
bubble.focus(); bubble.focus();
} }
...@@ -224,12 +212,8 @@ function hideNotificationBubble(event) { ...@@ -224,12 +212,8 @@ function hideNotificationBubble(event) {
// This will fade the bubble out of existence. // This will fade the bubble out of existence.
$('app-notification-bubble').classList.add("notification-bubble-closed"); $('app-notification-bubble').classList.add("notification-bubble-closed");
$('app-notification-bubble').classList.remove("notification-bubble-opened"); $('app-notification-bubble').classList.remove("notification-bubble-opened");
$('arrow-border').classList.add("notification-bubble-closed"); $('arrow-container').classList.add("notification-bubble-closed");
$('arrow-border').classList.remove("notification-bubble-opened"); $('arrow-container').classList.remove("notification-bubble-opened");
$('arrow-shadow').classList.add("notification-bubble-closed");
$('arrow-shadow').classList.remove("notification-bubble-opened");
$('arrow-contents').classList.add("notification-bubble-closed");
$('arrow-contents').classList.remove("notification-bubble-opened");
} }
var apps = (function() { var apps = (function() {
......
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