1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-02 17:18:31 +00:00

3.5.380. Fix bits rendering, maybe. Hook relocated scrolling logic. (Why is it in layout? :-/) Closes #57

This commit is contained in:
SirStendec 2016-11-27 15:33:55 -05:00
parent 32f3e9b20b
commit b5f2677642
4 changed files with 42 additions and 6 deletions

View file

@ -1,3 +1,9 @@
<div class="list-header">3.5.380 <time datetime="2016-11-23">(2016-11-23)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Lazy load bits rendering information to avoid a race condition.</li>
<li>Fixed: Hook the new scrolling logic in the Ember service layout.</li>
</ul>
<div class="list-header">3.5.379 <time datetime="2016-11-23">(2016-11-23)</time></div> <div class="list-header">3.5.379 <time datetime="2016-11-23">(2016-11-23)</time></div>
<ul class="chat-menu-content menu-side-padding"> <ul class="chat-menu-content menu-side-padding">
<li>Changed: Minor refactor to bits rendering.</li> <li>Changed: Minor refactor to bits rendering.</li>

View file

@ -91,7 +91,15 @@ FFZ.prototype.setup_bits = function() {
return this.error("Unable to locate the Ember service:bits-rendering-config"); return this.error("Unable to locate the Ember service:bits-rendering-config");
Service.reopen({ Service.reopen({
ffz_has_css: false,
ffz_get_tier: function(prefix, amount) { ffz_get_tier: function(prefix, amount) {
if ( ! this.get('isLoaded') ) {
this._actionPromiseCache = false;
this.loadRenderConfig();
} else if ( ! this.ffz_has_css )
this.ffz_update_css();
var config = this._getConfigPrefix(prefix) || {}, var config = this._getConfigPrefix(prefix) || {},
tiers = config.tiers || [], tiers = config.tiers || [],
tier = null, tier = null,
@ -157,12 +165,17 @@ FFZ.prototype.setup_bits = function() {
} }
utils.update_css(f._chat_style, 'bit-styles', output.join('')); utils.update_css(f._chat_style, 'bit-styles', output.join(''));
this.ffz_has_css = true;
}.observes('config'),
}.observes('config') loadRenderConfig: function() {
var out = this._super();
if ( ! this.get('config') )
this._actionPromiseCache = false;
return out;
}
}); });
if ( ! Service.get('isLoaded') ) if ( Service.get('isLoaded') )
Service.loadRenderConfig(); Service.loadRenderConfig();
else
Service.ffz_update_css();
} }

View file

@ -1,5 +1,7 @@
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
utils = require('../utils'); utils = require('../utils'),
route_helper;
// -------------------- // --------------------
@ -169,6 +171,12 @@ FFZ.prototype.setup_layout = function() {
s.id = 'ffz-layout-css'; s.id = 'ffz-layout-css';
document.head.appendChild(s); document.head.appendChild(s);
try {
route_helper = window.require("web-client/utilities/route-matcher");
} catch(err) {
this.error("Unable to require the route-matcher utility.", err);
}
var Layout = utils.ember_lookup('service:layout'), var Layout = utils.ember_lookup('service:layout'),
f = this; f = this;
@ -183,6 +191,15 @@ FFZ.prototype.setup_layout = function() {
portraitVideoBelow: false, portraitVideoBelow: false,
channelCoverHeight: function() {
var setting = f.settings.hide_channel_banner,
banner_hidden = setting === 1 ? f.settings.channel_bar_bottom : setting > 0;
return ( banner_hidden || ! route_helper || route_helper.routeMatches && route_helper.routeMatches(this.get('globals.currentPath'), route_helper.ROUTES.CHANNEL_ANY) ) ?
0 : 380;
}.property("globals.currentPath"),
portraitMode: function() { portraitMode: function() {
var raw = this.get("rawPortraitMode"); var raw = this.get("rawPortraitMode");
this.set('portraitVideoBelow', raw === 3 || raw === 4); this.set('portraitVideoBelow', raw === 3 || raw === 4);

View file

@ -61,7 +61,7 @@ FFZ.channel_metadata = {};
// Version // Version
var VER = FFZ.version_info = { var VER = FFZ.version_info = {
major: 3, minor: 5, revision: 379, major: 3, minor: 5, revision: 380,
toString: function() { toString: function() {
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || ""); return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
} }