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"),
|
"hours" => _("hours"),
|
||||||
"minutes" => _("minutes"),
|
"minutes" => _("minutes"),
|
||||||
"items" => _("items"),
|
"items" => _("items"),
|
||||||
"remaining" => _("remaining time in show")
|
"remaining" => _("time remaining in show")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $this->limitOptions;
|
return $this->limitOptions;
|
||||||
|
|
|
@ -707,7 +707,7 @@ table.library-get-file-md.table-small{
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp_input_select{
|
.sp_input_select{
|
||||||
width: 130px;
|
width: 140px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp_input_text_limit{
|
.sp_input_text_limit{
|
||||||
|
|
|
@ -292,6 +292,18 @@ function setSmartBlockEvents() {
|
||||||
AIRTIME.library.checkAddButton();
|
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 **********/
|
/********** CRITERIA CHANGE **********/
|
||||||
form.find('select[id^="sp_criteria"]:not([id^="sp_criteria_modifier"])').live("change", function(){
|
form.find('select[id^="sp_criteria"]:not([id^="sp_criteria_modifier"])').live("change", function(){
|
||||||
var index = getRowIndex($(this).parent());
|
var index = getRowIndex($(this).parent());
|
||||||
|
@ -461,6 +473,9 @@ function setupUI() {
|
||||||
shuffleButton = activeTab.find('button[name="shuffle_button"]'),
|
shuffleButton = activeTab.find('button[name="shuffle_button"]'),
|
||||||
generateButton = activeTab.find('button[name="generate_button"]'),
|
generateButton = activeTab.find('button[name="generate_button"]'),
|
||||||
fadesButton = activeTab.find('#spl_crossfade, #pl-bl-clear-content');
|
fadesButton = activeTab.find('#spl_crossfade, #pl-bl-clear-content');
|
||||||
|
if (activeTab.find('#sp_limit_options').val() == 'remaining') {
|
||||||
|
disableAndHideLimitValue();
|
||||||
|
}
|
||||||
|
|
||||||
if (!plContents.hasClass('spl_empty')) {
|
if (!plContents.hasClass('spl_empty')) {
|
||||||
if (shuffleButton.hasClass('ui-state-disabled')) {
|
if (shuffleButton.hasClass('ui-state-disabled')) {
|
||||||
|
@ -611,6 +626,14 @@ function disableAndHideExtraField(valEle, index) {
|
||||||
var criteria_value = $('#sp_criteria_value_'+index);
|
var criteria_value = $('#sp_criteria_value_'+index);
|
||||||
sizeTextBoxes(criteria_value, 'sp_extra_input_text', 'sp_input_text');
|
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) {
|
function sizeTextBoxes(ele, classToRemove, classToAdd) {
|
||||||
if (ele.hasClass(classToRemove)) {
|
if (ele.hasClass(classToRemove)) {
|
||||||
|
|
Loading…
Reference in New Issue