Merge pull request #1933 from MediaBrowser/dev

add new streambuilder options
This commit is contained in:
Luke 2016-07-09 13:42:14 -04:00 committed by GitHub
commit 8651321ba1
7 changed files with 70 additions and 39 deletions

View File

@ -0,0 +1,45 @@
define(['css!./emby-radio', 'registerElement'], function () {
var EmbyRadioPrototype = Object.create(HTMLInputElement.prototype);
function onKeyDown(e) {
// Don't submit form on enter
if (e.keyCode == 13) {
e.preventDefault();
this.checked = true;
return false;
}
}
EmbyRadioPrototype.attachedCallback = function () {
if (this.getAttribute('data-radio') == 'true') {
return;
}
this.setAttribute('data-radio', 'true');
this.classList.add('mdl-radio__button');
var labelElement = this.parentNode;
//labelElement.classList.add('"mdl-radio mdl-js-radio mdl-js-ripple-effect');
labelElement.classList.add('mdl-radio');
labelElement.classList.add('mdl-js-radio');
labelElement.classList.add('mdl-js-ripple-effect');
var labelTextElement = labelElement.querySelector('span');
labelElement.insertAdjacentHTML('beforeend', '<span class="mdl-checkbox__focus-helper"></span><span class="checkboxOutline"><span class="mdl-checkbox__tick-outline"></span></span>');
labelTextElement.classList.add('radioButtonLabel');
this.addEventListener('keydown', onKeyDown);
};
document.registerElement('emby-radio', {
prototype: EmbyRadioPrototype,
extends: 'input'
});
});

View File

@ -1,4 +1,4 @@
define(['dialogHelper', 'events', 'browser', 'emby-checkbox', 'emby-collapse', 'css!components/filterdialog/style', 'paper-radio-button', 'paper-radio-group'], function (dialogHelper, events, browser) {
define(['dialogHelper', 'events', 'browser', 'emby-checkbox', 'emby-collapse', 'css!components/filterdialog/style'], function (dialogHelper, events, browser) {
function renderOptions(context, selector, cssClass, items, isCheckedFn) {
@ -129,7 +129,7 @@
context.querySelector('#chkMissingEpisode').checked = query.IsMissing == true;
context.querySelector('#chkFutureEpisode').checked = query.IsUnaired == true;
context.querySelector('.playersRadioGroup').selected = query.MinPlayers == null ? 'all' : query.MinPlayers;
//context.querySelector('.playersRadioGroup').selected = query.MinPlayers == null ? 'all' : query.MinPlayers;
for (i = 0, length = elems.length; i < length; i++) {
@ -187,7 +187,7 @@
}
if (options.mode == 'games') {
context.querySelector('.players').classList.remove('hide');
//context.querySelector('.players').classList.remove('hide');
}
if (options.mode == 'movies' || options.mode == 'series' || options.mode == 'games' || options.mode == 'episodes') {
@ -446,17 +446,17 @@
triggerChange(self);
});
context.querySelector('.playersRadioGroup').addEventListener('iron-select', function (e) {
//context.querySelector('.playersRadioGroup').addEventListener('iron-select', function (e) {
query.StartIndex = 0;
var val = e.target.selected;
var newValue = val == "all" ? null : val;
var changed = query.MinPlayers != newValue;
query.MinPlayers = newValue;
if (changed) {
triggerChange(self);
}
});
// query.StartIndex = 0;
// var val = e.target.selected;
// var newValue = val == "all" ? null : val;
// var changed = query.MinPlayers != newValue;
// query.MinPlayers = newValue;
// if (changed) {
// triggerChange(self);
// }
//});
context.addEventListener('change', function (e) {
@ -570,22 +570,12 @@
dlg.addEventListener('close', resolve);
var onTimeout = function () {
updateFilterControls(dlg, options);
bindEvents(dlg);
updateFilterControls(dlg, options);
bindEvents(dlg);
if (enableDynamicFilters(options.mode)) {
dlg.classList.add('dynamicFilterDialog');
loadDynamicFilters(dlg, Dashboard.getCurrentUserId(), options.query);
}
};
// In browsers without native web components (FF/IE), there are some quirks with the checkboxes appearing incorrectly with no visible checkmark
// Applying a delay after setting innerHTML seems to resolve this
if (browser.animate) {
onTimeout();
} else {
setTimeout(onTimeout, 100);
if (enableDynamicFilters(options.mode)) {
dlg.classList.add('dynamicFilterDialog');
loadDynamicFilters(dlg, Dashboard.getCurrentUserId(), options.query);
}
}

View File

@ -120,7 +120,7 @@
</div>
</div>
<div class="players hide">
<!--<div class="players hide">
<h2 style="margin-bottom: .25em;">
${HeaderNumberOfPlayers}
</h2>
@ -130,7 +130,7 @@
<paper-radio-button class="radioPlayers" name="3">${Option3Player}</paper-radio-button>
<paper-radio-button class="radioPlayers" name="4">${Option4Player}</paper-radio-button>
</paper-radio-group>
</div>
</div>-->
<div is="emby-collapse" title="${HeaderGenres}" class="genreFilters hide">
<div class="collapseContent filterOptions">

View File

@ -22,8 +22,8 @@
.dynamicFilterDialog {
width: auto;
left: 15vw !important;
right: 15vw !important;
left: 10vw !important;
right: 10vw !important;
margin-left: 0 !important;
}
}
@ -35,9 +35,4 @@
margin-left: -150px !important;
left: 50% !important;
}
}
.filterDialog paper-radio-button {
display: block;
padding-left: 0;
}
}

View File

@ -1358,7 +1358,7 @@
}
else if (item.ParentPrimaryImageTag) {
imgUrl = ApiClient.getImageUrl(item.ParentPrimaryImageItemId, {
imgUrl = ApiClient.getScaledImageUrl(item.ParentPrimaryImageItemId, {
type: "Primary",
maxWidth: downloadWidth,
tag: item.ParentPrimaryImageTag,

View File

@ -1799,6 +1799,7 @@ var AppInfo = {};
define("emby-select", [embyWebComponentsBowerPath + "/emby-select/emby-select"], returnFirstDependency);
define("emby-slider", [embyWebComponentsBowerPath + "/emby-slider/emby-slider"], returnFirstDependency);
define("emby-checkbox", [embyWebComponentsBowerPath + "/emby-checkbox/emby-checkbox"], returnFirstDependency);
define("emby-radio", [embyWebComponentsBowerPath + "/emby-radio/emby-radio"], returnFirstDependency);
define("emby-textarea", [embyWebComponentsBowerPath + "/emby-textarea/emby-textarea"], returnFirstDependency);
define("collectionEditor", [embyWebComponentsBowerPath + "/collectioneditor/collectioneditor"], returnFirstDependency);
define("playlistEditor", [embyWebComponentsBowerPath + "/playlisteditor/playlisteditor"], returnFirstDependency);