From 58dd09f13620bcbbab5dcc4507e3989a72ca7844 Mon Sep 17 00:00:00 2001 From: Naomi Date: Mon, 7 Apr 2014 12:59:55 -0400 Subject: [PATCH] CC-5778 : Improving Builder Rendering Time making it work in firefox. --- airtime_mvc/public/css/showbuilder.css | 12 ++-- airtime_mvc/public/css/styles.css | 2 +- .../public/js/airtime/showbuilder/builder.js | 55 ++++++++----------- 3 files changed, 28 insertions(+), 41 deletions(-) diff --git a/airtime_mvc/public/css/showbuilder.css b/airtime_mvc/public/css/showbuilder.css index 50d3454c8..da8a87311 100644 --- a/airtime_mvc/public/css/showbuilder.css +++ b/airtime_mvc/public/css/showbuilder.css @@ -115,14 +115,16 @@ div.sb-timerange input.error { } .innerWrapper { - position:relative; - width:100%; + position: relative; + width: 100%; + height: 100%; } .marker { background: url(images/tl-arrow.png) no-repeat scroll 3px 4px; display: block; height: 9px; - left: -13px; + left: -18px; + bottom: -14px; padding: 4px 0 4px 3px; position: absolute; width: 9px; @@ -255,10 +257,6 @@ table.datatable tr.sb-header.odd:hover td, table.datatable tr.sb-header.even:hov margin-right:5px; } -.sb-checkbox, .sb-empty td { - position: relative; -} - /* * keep the dialog css at the bottom so it can override previous rules if needed. */ diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index a63f4975e..8e85cc1fe 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -701,7 +701,7 @@ dl.inline-list dd { .datatable tr td, .datatable tr th { border-color: #b1b1b1; border-style: solid; - border-width: 1px 0 0 1px; + border-width: 0 0 1px 1px; font-size: 13px; padding: 5px 5px; } diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 3d3a09f76..4dcc4334d 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -481,7 +481,16 @@ var AIRTIME = (function(AIRTIME){ $nRow = $(nRow), $image, $div, - headerIcon; + headerIcon, + $wrapper; + + //http://stackoverflow.com/a/6119684 + $wrapper = $("
", { + "class": "innerWrapper" + }); + + $node = $(nRow.children[0]); + $node.html($wrapper); fnPrepareSeparatorRow = function fnPrepareSeparatorRow(sRowContent, sClass, iNodeIndex) { $node = $(nRow.children[iNodeIndex]); @@ -499,9 +508,6 @@ var AIRTIME = (function(AIRTIME){ if (aData.header === true) { //remove the column classes from all tds. $nRow.find('td').removeClass(); - - $node = $(nRow.children[0]); - $node.html(""); cl = 'sb-header'; if (aData.record === true) { @@ -511,13 +517,13 @@ var AIRTIME = (function(AIRTIME){ $div = $("
", { "class": "small-icon " + headerIcon }); - $node.append($div); + $wrapper.append($div); } else if (aData.rebroadcast === true) { $div = $("
", { "class": "small-icon rebroadcast" }); - $node.append($div); + $wrapper.append($div); } sSeparatorHTML = ''+aData.title+''; @@ -544,17 +550,15 @@ var AIRTIME = (function(AIRTIME){ else if (aData.footer === true) { //remove the column classes from all tds. $nRow.find('td').removeClass(); - - $node = $(nRow.children[0]); cl = 'sb-footer'; //check the show's content status. if (aData.runtime >= 0) { - $node.html(''); + $wrapper.html(''); cl = cl + ' ui-state-highlight'; } else { - $node.html(''); + $wrapper.html(''); cl = cl + ' ui-state-error'; } @@ -564,13 +568,10 @@ var AIRTIME = (function(AIRTIME){ else if (aData.empty === true) { //remove the column classes from all tds. $nRow.find('td').removeClass(); - - $node = $(nRow.children[0]); - $node.html(''); - + //putting the cursor on the screen if (aData.allowed && $lib.length > 0 && $lib.filter(":visible").length > 0) { - $node.append('
'); + $wrapper.append('
'); } sSeparatorHTML = ''+$.i18n._("Show Empty")+''; @@ -582,9 +583,6 @@ var AIRTIME = (function(AIRTIME){ //remove the column classes from all tds. $nRow.find('td').removeClass(); - $node = $(nRow.children[0]); - $node.html(''); - sSeparatorHTML = ''+$.i18n._("Recording From Line In")+''; cl = cl + " sb-record odd"; @@ -622,18 +620,14 @@ var AIRTIME = (function(AIRTIME){ }); } - $node = $(nRow.children[0]); if (aData.allowed === true && aData.scheduled >= 1) { - $node.html(''); + $wrapper.html(''); //putting the cursor on the screen if ($lib.length > 0 && $lib.filter(":visible").length > 0) { - $node.append('
'); + $wrapper.append('
'); } } - else { - $node.html(''); - } } //add the show colour to the leftmost td @@ -675,8 +669,6 @@ var AIRTIME = (function(AIRTIME){ } else { $nRow.addClass("sb-allowed"); - $nRow.attr("id", aData.id); - $nRow.attr("si_id", aData.instance); } //status used to colour tracks. @@ -718,8 +710,7 @@ var AIRTIME = (function(AIRTIME){ } isInitialized = true; - var $td, - aData, + var aData, elements, i, length, temp, $cursorRows, @@ -730,7 +721,8 @@ var AIRTIME = (function(AIRTIME){ //only create the cursor arrows if the library is on the page. if ($lib.length > 0 && $lib.filter(":visible").length > 0) { - $cursorRows = $sbTable.find("tbody tr.sb-future.sb-allowed:not(.sb-header, .sb-empty)"); + //$cursorRows = $sbTable.find("tbody tr.sb-future.sb-allowed:not(.sb-header, .sb-empty)"); + $cursorRows = $sbTable.find("div.marker").parents("tr"); //re-highlight selected cursors before draw took place /* @@ -761,10 +753,7 @@ var AIRTIME = (function(AIRTIME){ //if there is only 1 cursor on the page highlight it by default. if ($cursorRows.length === 1) { - $td = $cursorRows.find("td:first"); - if (!$td.hasClass("dataTables_empty")) { - $cursorRows.addClass("cursor-selected-row"); - } + $cursorRows.addClass("cursor-selected-row"); } }