Added popup support

remotes/origin/1203
re0ne 11 years ago
parent 102bff02b1
commit d95d0ddb35
  1. 1
      templates/client/blank.html
  2. 19
      templates/client/static_client/js/rejs/banners.js

@ -136,6 +136,7 @@ This template include basic anf main styles and js files,
{% endif %} {% endif %}
{% include 'client/popups/callback.html' %} {% include 'client/popups/callback.html' %}
{% include 'client/includes/banners/popup.html' %}
{% block popup_banner %} {% block popup_banner %}
{% if not request.COOKIES.popover_test1 %} {% if not request.COOKIES.popover_test1 %}
{% if theme_for_filter %} {% if theme_for_filter %}

@ -59,6 +59,24 @@
var parent = document.getElementById(banner.id); var parent = document.getElementById(banner.id);
if (parent) { if (parent) {
if (banner.is_popup) {
if (banner.is_img) {
parent.innerHTML =
"<header class=\"clearfix\"><div class=\"pw-title\"></div></header><div class=\"pw-body clearfix\">" +
"<a href=\""+ banner.url + "\"><img src=\"" + banner.img + "\" alt=\"" + banner.alt + "\" /></a></div>";
} else if (banner.is_html) {
parent.innerHTML = banner.text;
}
$("#expo-form-popup").on("submit", function(e) {
e.preventDefault();
window.location = $("#expo-form-popup").attr("action");
});
setTimeout(function(){
$.fancybox.open([{"href": "#" + banner.id}], {});
}, 5000);
} else {
if (banner.is_img) { if (banner.is_img) {
var a = document.createElement("a"); var a = document.createElement("a");
a.href = banner.url; a.href = banner.url;
@ -73,6 +91,7 @@
parent.innerHTML = banner.text; parent.innerHTML = banner.text;
} }
} }
}
}; };

Loading…
Cancel
Save