create addBlock ajax service && added profile ads block

This commit is contained in:
vedatakd 2020-09-30 10:45:35 +03:00
parent 0ce72564c4
commit a9890488f9
2 changed files with 11 additions and 13 deletions

View File

@ -20,6 +20,8 @@
{{ asset_script("theme.js") }} {{ asset_script("theme.js") }}
{{ addBlock('block-service')|raw }}
{# Include Styles Loaded From Outside #} {# Include Styles Loaded From Outside #}
<style> <style>
{% for style in asset_inlines("styles.css", ["min"]) %} {% for style in asset_inlines("styles.css", ["min"]) %}

View File

@ -4,24 +4,21 @@ var ads_type = "";
var objJson = []; var objJson = [];
function prevPage() function prevPage() {
{
if (current_page > 1) { if (current_page > 1) {
current_page--; current_page--;
changePage(current_page); changePage(current_page);
} }
} }
function nextPage(event) function nextPage(event) {
{
if (current_page < numPages()) { if (current_page < numPages()) {
current_page++; current_page++;
changePage(current_page); changePage(current_page);
} }
} }
function changePage(page) function changePage(page) {
{
var btn_next = $("#btn_next"); var btn_next = $("#btn_next");
var btn_prev = $("#btn_prev"); var btn_prev = $("#btn_prev");
var listing_table = $("#nav-" + ads_type); var listing_table = $("#nav-" + ads_type);
@ -65,8 +62,7 @@ function changePage(page)
} }
} }
function numPages() function numPages() {
{
return Math.ceil(objJson.length / records_per_page); return Math.ceil(objJson.length / records_per_page);
} }
@ -164,7 +160,7 @@ function dropdownRow(id, type) {
extend_ad + extend_ad +
"</a>\n"; "</a>\n";
dropdown += "</div></div>"; dropdown += getBlock('profile/dropdown-ad', {'id': id}) + "</div></div>";
return dropdown; return dropdown;
} }