From 6823abb8024060eee6a4f8eaace288ed9dd58e65 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 27 Jun 2012 17:21:17 -0700 Subject: Styles Controller - Fix specificity comparison in hasGreaterSpecificity() --- js/controllers/styles-controller.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 0f847653..47c63c09 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -213,6 +213,9 @@ var stylesController = exports.StylesController = Montage.create(Component, { stylesheet.insertRule(ruleText, index); + ///// Invalidate cache because rule dominance is affected + this._clearCache(); + this.styleSheetModified(stylesheet); rule = stylesheet.rules[index]; @@ -775,7 +778,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { var a = this._getMostSpecificSelectorForElement(element, rule1[this.CONST.SPECIFICITY_KEY]), b = this._getMostSpecificSelectorForElement(element, rule2[this.CONST.SPECIFICITY_KEY]), win = element.ownerDocument.defaultView, - order; + order, sheetAIndex, sheetBIndex, ruleAIndex, ruleBIndex; order = this.compareSpecificity(a.specificity, b.specificity); @@ -786,9 +789,9 @@ var stylesController = exports.StylesController = Montage.create(Component, { /// If tied again (same sheet), determine which is further down in the sheet if(sheetAIndex === sheetBIndex) { ruleAIndex = this.getRuleIndex(rule1); ruleBIndex = this.getRuleIndex(rule2); - return ruleAIndex < ruleBIndex ? 1 : (ruleAIndex > ruleBIndex) ? -1 : 0; + return ruleAIndex < ruleBIndex ? false : (ruleAIndex > ruleBIndex) ? true : false; } else { - return sheetAIndex < sheetBIndex ? 1 : (sheetAIndex > sheetBIndex) ? -1 : 0; + return sheetAIndex < sheetBIndex ? false : (sheetAIndex > sheetBIndex) ? true : false; } } @@ -1552,6 +1555,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { value: function(el, property, rule) { if(!el.elementModel) { return false; } /// return null if there is no element model + console.log("Setting cache for property: ", property); this._cacheHistory.push({ rule: rule, element: el, @@ -1614,6 +1618,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { if(!element) { this._cacheHistory = null; this._cacheHistory = []; + console.log("Removing cache: ", this._cacheHistory); } } -- cgit v1.2.3 From d2af32f2c8a408dbf6bf0aded5c381b9daf52aaa Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 28 Jun 2012 14:58:49 -0700 Subject: Fix for the youtube component close button on windows Signed-off-by: Valerio Virgillito --- .../montage-google/youtube-channel.reel/youtube-channel.html | 10 +++++++++- .../montage-google/youtube-channel.reel/youtube-channel.js | 9 +++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/node_modules/montage-google/youtube-channel.reel/youtube-channel.html b/node_modules/montage-google/youtube-channel.reel/youtube-channel.html index 01cc42f3..65ffc945 100644 --- a/node_modules/montage-google/youtube-channel.reel/youtube-channel.html +++ b/node_modules/montage-google/youtube-channel.reel/youtube-channel.html @@ -96,7 +96,7 @@ .montage-youtube-channel-close { position: absolute; top: 5px; - left: 5px; + right: 5px; width: 25px; height: 25px; @@ -107,6 +107,14 @@ color: #EEE; outline: none; + text-align: center; + padding: 0; + } + + .montage-youtube-channel .montage-youtube-player { + border-top: 35px solid #000; + -webkit-box-sizing: border-box; + box-sizing: border-box; } diff --git a/node_modules/montage-google/youtube-channel.reel/youtube-channel.js b/node_modules/montage-google/youtube-channel.reel/youtube-channel.js index 95cd336a..f06216e1 100644 --- a/node_modules/montage-google/youtube-channel.reel/youtube-channel.js +++ b/node_modules/montage-google/youtube-channel.reel/youtube-channel.js @@ -180,8 +180,12 @@ var YoutubeChannel = exports.YoutubeChannel = Montage.create(Component, { // take the video from the top only once it's stopped animating window.setTimeout(function() { - self.element.style.zIndex = null; - }, 500); + self._element.style.zIndex = null; + // HACK: Trigger a redraw so that Flash in Chrome on + // Windows doesn't remain rendered on top of everything, + // despite actually being hidden + self.player.element.getBoundingClientRect(); + }, 510); } } @@ -196,6 +200,7 @@ var YoutubeChannel = exports.YoutubeChannel = Montage.create(Component, { value: function() { var doc = this._element.ownerDocument; + this._popupElement.style.width = doc.width + "px"; this.player.width = doc.width; this.player.height = doc.height; -- cgit v1.2.3 From 72a236ce7af6711f9d30762c2409d0ebd5ecf7aa Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 29 Jun 2012 09:14:30 -0700 Subject: Styles Controller - removing console logs --- js/controllers/styles-controller.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 47c63c09..e25ed20c 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -1555,7 +1555,6 @@ var stylesController = exports.StylesController = Montage.create(Component, { value: function(el, property, rule) { if(!el.elementModel) { return false; } /// return null if there is no element model - console.log("Setting cache for property: ", property); this._cacheHistory.push({ rule: rule, element: el, @@ -1618,7 +1617,6 @@ var stylesController = exports.StylesController = Montage.create(Component, { if(!element) { this._cacheHistory = null; this._cacheHistory = []; - console.log("Removing cache: ", this._cacheHistory); } } -- cgit v1.2.3