From 05e66244cc719cbd16eb48072d3636cde0f4573e Mon Sep 17 00:00:00 2001 From: Gabriela Navarro Date: Thu, 16 Jul 2015 13:06:24 +0000 Subject: [PATCH] Fix the url of the download block "New Link" for when the noosfero is in subdir --- public/blocks/software-download.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/blocks/software-download.js b/public/blocks/software-download.js index 8716d24..94bda3f 100644 --- a/public/blocks/software-download.js +++ b/public/blocks/software-download.js @@ -1,6 +1,11 @@ -modulejs.define('SoftwareDownload', ['jquery'], function($) { +modulejs.define('SoftwareDownload', ['jquery', 'NoosferoRoot'], function($, NoosferoRoot) { 'use strict'; + var AJAX_URL = { + get_download_template: + NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_block_template") + }; + var $download_html_template; function getDownloadListTemplate() { @@ -9,7 +14,7 @@ modulejs.define('SoftwareDownload', ['jquery'], function($) { if(block_template && block_template.length > 0) { $download_html_template = block_template; } else { - $.get('/plugin/software_communities/get_block_template', function(response) { + $.get(AJAX_URL.get_download_template, function(response) { $download_html_template = response; sessionStorage.setItem('download_list_block_template', response); }); -- libgit2 0.21.2