| 1 |
(function( $ ) { |
| 2 |
'use strict'; |
| 3 |
$(document).ready(function () { |
| 4 |
|
| 5 |
$(document).find('#ays-category').select2({ |
| 6 |
placeholder: 'Select category' |
| 7 |
}); |
| 8 |
|
| 9 |
$(document).find('#ays-status').select2({ |
| 10 |
placeholder: 'Select status' |
| 11 |
}); |
| 12 |
|
| 13 |
// |
| 14 |
$(document).find('.nav-tab-wrapper a.nav-tab').on('click', function (e) { |
| 15 |
if(! $(this).hasClass('no-js')){ |
| 16 |
var elemenetID = $(this).attr('href'); |
| 17 |
var active_tab = $(this).attr('data-tab'); |
| 18 |
$(document).find('.nav-tab-wrapper a.nav-tab').each(function () { |
| 19 |
if ($(this).hasClass('nav-tab-active')) { |
| 20 |
$(this).removeClass('nav-tab-active'); |
| 21 |
} |
| 22 |
}); |
| 23 |
$(this).addClass('nav-tab-active'); |
| 24 |
$(document).find('.ays-tab-content').each(function () { |
| 25 |
$(this).css('display', 'none'); |
| 26 |
}); |
| 27 |
$(document).find("[name='ays_tab']").val(active_tab); |
| 28 |
$('.ays-tab-content' + elemenetID).css('display', 'block'); |
| 29 |
e.preventDefault(); |
| 30 |
} |
| 31 |
}); |
| 32 |
|
| 33 |
|
| 34 |
$(document).find('#ays_select_forms').select2({ |
| 35 |
allowClear: true, |
| 36 |
placeholder: false |
| 37 |
}); |
| 38 |
|
| 39 |
$(document).find('#ays_user_roles').select2({ |
| 40 |
allowClear: true, |
| 41 |
placeholder: aysChartBuilderAdminSettings.selectUserRoles |
| 42 |
}); |
| 43 |
|
| 44 |
$(document).find('#ays_user_roles_to_change_plugin').select2({ |
| 45 |
allowClear: true, |
| 46 |
placeholder: aysChartBuilderAdminSettings.selectUserRoles |
| 47 |
}); |
| 48 |
|
| 49 |
$(document).find('#ays_form_default_type').select2({ |
| 50 |
allowClear: true, |
| 51 |
placeholder: aysChartBuilderAdminSettings.selectQuestionDefaultType |
| 52 |
}); |
| 53 |
|
| 54 |
// =============================================================== |
| 55 |
// ===================== Integrations ========================= |
| 56 |
// =============================================================== |
| 57 |
|
| 58 |
$(document).find("#googleInstructionsPopOver").popover({ |
| 59 |
content: $(document).find("#googleInstructions").html(), |
| 60 |
html: true, |
| 61 |
}); |
| 62 |
|
| 63 |
$(document).find("#googleInstructionsPopOver").on("click" , function(){ |
| 64 |
$(document).find(".popover").addClass("ays-google-sheet-popover"); |
| 65 |
}); |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
}); |
| 70 |
|
| 71 |
})( jQuery ); |
| 72 |
|