summaryrefslogtreecommitdiffstats
path: root/admin/survey/script/themes.js
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/script/themes.js
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to 'admin/survey/script/themes.js')
-rw-r--r--admin/survey/script/themes.js68
1 files changed, 43 insertions, 25 deletions
diff --git a/admin/survey/script/themes.js b/admin/survey/script/themes.js
index 0ec5257..d48ebc1 100644
--- a/admin/survey/script/themes.js
+++ b/admin/survey/script/themes.js
@@ -10,13 +10,13 @@ function themes_init() {
$.post("ajax.php?t=theme&a=changeProgressbar", {anketa:srv_meta_anketa_id, progressbar:progressbar}, function() {});
});
- $("a.theme_links_preview").live('click', function(event) {
+ $("div.theme_links_preview").live('click', function(event) {
event.preventDefault();
event.stopPropagation();
window.open($(this).attr('src')+'&size=full', '_blank');
});
- $("a.theme_delete.theme").live('click', function(event) {
+ $("div.theme_delete.theme").live('click', function(event) {
event.preventDefault();
event.stopPropagation();
@@ -27,13 +27,6 @@ function themes_init() {
});
}
});
-
- /*$("#div_theme_group span.theme_links_rename").live('click', function(event) {
- var theme = $(this).attr('theme');
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=theme&a=theme_rename', {anketa:srv_meta_anketa_id, theme:theme});
- });*/
$("#theme_rename_confirm").live('click', function(event) {
var theme_new_name = $("#theme_new_name").val();
@@ -64,20 +57,6 @@ function themes_init() {
return false;
});
- // change theme
- $("#div_theme_group img.theme").live('click', function(event) {
- event.preventDefault();
- event.stopPropagation();
- var css = $(this).attr('css');
- var gid = $(this).attr('gid');
- $.post("ajax.php?t=theme&a=changeTheme", {anketa:srv_meta_anketa_id, gid:gid,css:css}, function(data) {
- $("#div_theme_group_holder").html(data.group_themes);
- $('#div_theme_groups').html(data.theme_name);
- $('#div_theme_group_holder').append('<div id="success_save">'+lang['srv_success_save']+'</div>');
- show_success_save();
- }, 'json');
- });
-
//change checkbox value
$('#izbira-checkbox-gumbov').change(function(){
var izbira = $(this).find(":selected").val();
@@ -222,6 +201,45 @@ function te_change_name (_this) {
function toggle_custom_themes () {
- $('.user_themes_button').toggleClass("plus minus");
- $('#div_theme_group.custom').toggle('medium');
+ $('.user_themes_button').toggleClass("fa-angle-up");
+ $('.div_theme_group.custom').slideToggle('medium');
+}
+
+function changeTheme (gid, css) {
+ $.post("ajax.php?t=theme&a=changeTheme", {anketa:srv_meta_anketa_id, gid:gid,css:css}, function(data) {
+ $("#div_theme_group_holder").html(data.group_themes);
+ $('#div_theme_groups').html(data.theme_name);
+ $('#div_theme_group_holder').append('<div id="success_save">'+lang['srv_success_save']+'</div>');
+ actionNotePopup('success_save', 'success');
+ }, 'json');
+}
+
+function show_settings(id_of_element){
+
+ if($('#additional_settings_'+id_of_element).hasClass('displayNone')){
+ $('.buttons-window').addClass('displayNone');
+ $('#additional_settings_'+id_of_element).removeClass('displayNone');
+ }
+ else{
+ $('.buttons-window').addClass('displayNone');
+ }
+}
+
+
+function show_settings_mobile(id_of_element){
+
+ // var options = document.getElementsByClassName("options_mobile"+id_of_element)[0];
+ var options = document.getElementById("options_mobile"+id_of_element);
+ var additional_settings = document.getElementById("additional_settings_mobile_"+id_of_element);
+
+ additional_settings.classList.toggle("active");
+
+
+ if($('#additional_settings_mobile_'+id_of_element).hasClass('displayNone')){
+ $('.buttons-window').addClass('displayNone');
+ $('#additional_settings_mobile_'+id_of_element).removeClass('displayNone');
+ }
+ else{
+ $('.buttons-window').addClass('displayNone');
+ }
} \ No newline at end of file