Added jquery to hide or remove limit value
This commit is contained in:
parent
c759f8b8aa
commit
008530364b
|
@ -160,7 +160,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
"hours" => _("hours"),
|
||||
"minutes" => _("minutes"),
|
||||
"items" => _("items"),
|
||||
"remaining" => _("remaining time in show")
|
||||
"remaining" => _("time remaining in show")
|
||||
);
|
||||
}
|
||||
return $this->limitOptions;
|
||||
|
|
|
@ -707,7 +707,7 @@ table.library-get-file-md.table-small{
|
|||
}
|
||||
|
||||
.sp_input_select{
|
||||
width: 130px;
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.sp_input_text_limit{
|
||||
|
|
|
@ -292,6 +292,18 @@ function setSmartBlockEvents() {
|
|||
AIRTIME.library.checkAddButton();
|
||||
});
|
||||
|
||||
/********** LIMIT CHANGE *************/
|
||||
form.find('select[id="sp_limit_options"]').live("change", function() {
|
||||
var limVal = form.find('input[id="sp_limit_value"]');
|
||||
if ($(this).val() === 'remaining') {
|
||||
disableAndHideLimitValue();
|
||||
}
|
||||
else {
|
||||
enableAndShowLimitValue();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/********** CRITERIA CHANGE **********/
|
||||
form.find('select[id^="sp_criteria"]:not([id^="sp_criteria_modifier"])').live("change", function(){
|
||||
var index = getRowIndex($(this).parent());
|
||||
|
@ -461,6 +473,9 @@ function setupUI() {
|
|||
shuffleButton = activeTab.find('button[name="shuffle_button"]'),
|
||||
generateButton = activeTab.find('button[name="generate_button"]'),
|
||||
fadesButton = activeTab.find('#spl_crossfade, #pl-bl-clear-content');
|
||||
if (activeTab.find('#sp_limit_options').val() == 'remaining') {
|
||||
disableAndHideLimitValue();
|
||||
}
|
||||
|
||||
if (!plContents.hasClass('spl_empty')) {
|
||||
if (shuffleButton.hasClass('ui-state-disabled')) {
|
||||
|
@ -611,6 +626,14 @@ function disableAndHideExtraField(valEle, index) {
|
|||
var criteria_value = $('#sp_criteria_value_'+index);
|
||||
sizeTextBoxes(criteria_value, 'sp_extra_input_text', 'sp_input_text');
|
||||
}
|
||||
function disableAndHideLimitValue() {
|
||||
console.log('we hide it');
|
||||
$('#sp_limit_value').hide();
|
||||
}
|
||||
function enableAndShowLimitValue() {
|
||||
console.log('we show it');
|
||||
$('#sp_limit_value').show();
|
||||
}
|
||||
|
||||
function sizeTextBoxes(ele, classToRemove, classToAdd) {
|
||||
if (ele.hasClass(classToRemove)) {
|
||||
|
|
Loading…
Reference in New Issue