Fixed modal madness in Snapcast frontend

This commit is contained in:
Fabio Manganiello 2019-03-27 00:20:49 +01:00
parent 31108b21e5
commit 67fd88950a

View file

@ -102,17 +102,13 @@ $(document).ready(function() {
var $hostTitle = $('<h1></h1>') var $hostTitle = $('<h1></h1>')
.addClass('snapcast-host-settings') .addClass('snapcast-host-settings')
.addClass('snapcast-settings-btn'); .addClass('snapcast-settings-btn')
.attr('data-modal', '#snapcast-host-modal');
var $hostSettings = $('<i></i>')
.attr('data-modal', '#snapcast-host-modal')
.addClass('fa fa-ellipsis-v');
var $hostName = $('<span></span>') var $hostName = $('<span></span>')
.attr('data-modal', '#snapcast-host-modal') .attr('data-modal', '#snapcast-host-modal')
.html('&nbsp; ' + name); .text(name);
$hostSettings.appendTo($hostTitle);
$hostName.appendTo($hostTitle); $hostName.appendTo($hostTitle);
$hostTitle.appendTo($hostHeader); $hostTitle.appendTo($hostHeader);
$hostHeader.appendTo($host); $hostHeader.appendTo($host);
@ -132,15 +128,9 @@ $(document).ready(function() {
var $groupTitle = $('<h2></h2>') var $groupTitle = $('<h2></h2>')
.addClass('snapcast-group-settings') .addClass('snapcast-group-settings')
.addClass('snapcast-settings-btn') .addClass('snapcast-settings-btn')
.addClass('eleven columns');
var $groupSettings = $('<i></i>')
.attr('data-modal', '#snapcast-group-modal') .attr('data-modal', '#snapcast-group-modal')
.addClass('fa fa-ellipsis-v'); .addClass('eleven columns')
.text(groupName);
var $groupName = $('<span></span>')
.attr('data-modal', '#snapcast-group-modal')
.html('&nbsp; ' + groupName);
var $groupMuteToggle = createPowerToggleElement({ var $groupMuteToggle = createPowerToggleElement({
id: group.id, id: group.id,
@ -149,8 +139,6 @@ $(document).ready(function() {
.addClass('snapcast-mute-toggle') .addClass('snapcast-mute-toggle')
.addClass('snapcast-group-mute-toggle'); .addClass('snapcast-group-mute-toggle');
$groupSettings.appendTo($groupTitle);
$groupName.appendTo($groupTitle);
$groupTitle.appendTo($groupHeader); $groupTitle.appendTo($groupHeader);
$groupMuteToggle.appendTo($groupHeader); $groupMuteToggle.appendTo($groupHeader);
$groupHeader.appendTo($group); $groupHeader.appendTo($group);
@ -178,15 +166,9 @@ $(document).ready(function() {
var $clientTitle = $('<h3></h3>') var $clientTitle = $('<h3></h3>')
.addClass('snapcast-settings-btn') .addClass('snapcast-settings-btn')
.addClass('snapcast-client-settings') .addClass('snapcast-client-settings')
.addClass('two columns');
var $clientSettings = $('<i></i>')
.attr('data-modal', '#snapcast-client-modal') .attr('data-modal', '#snapcast-client-modal')
.addClass('fa fa-ellipsis-v'); .addClass('two columns')
.text(clientName);
var $clientName = $('<span></span>')
.attr('data-modal', '#snapcast-client-modal')
.html('&nbsp; ' + clientName);
var $volumeSlider = $('<input></input>') var $volumeSlider = $('<input></input>')
.addClass('slider snapcast-volume-slider') .addClass('slider snapcast-volume-slider')
@ -204,8 +186,6 @@ $(document).ready(function() {
.addClass('snapcast-mute-toggle') .addClass('snapcast-mute-toggle')
.addClass('snapcast-client-mute-toggle'); .addClass('snapcast-client-mute-toggle');
$clientSettings.appendTo($clientTitle);
$clientName.appendTo($clientTitle);
$clientTitle.appendTo($clientRow); $clientTitle.appendTo($clientRow);
$volumeSlider.appendTo($clientRow); $volumeSlider.appendTo($clientRow);
$clientMuteToggle.appendTo($clientRow); $clientMuteToggle.appendTo($clientRow);