Commit 05e66244cc719cbd16eb48072d3636cde0f4573e

Authored by Gabriela Navarro
1 parent 7908aa51

Fix the url of the download block "New Link" for when the noosfero is in subdir

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing 1 changed file with 7 additions and 2 deletions   Show diff stats
public/blocks/software-download.js
1   -modulejs.define('SoftwareDownload', ['jquery'], function($) {
  1 +modulejs.define('SoftwareDownload', ['jquery', 'NoosferoRoot'], function($, NoosferoRoot) {
2 2 'use strict';
3 3  
  4 + var AJAX_URL = {
  5 + get_download_template:
  6 + NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_block_template")
  7 + };
  8 +
4 9 var $download_html_template;
5 10  
6 11 function getDownloadListTemplate() {
... ... @@ -9,7 +14,7 @@ modulejs.define(&#39;SoftwareDownload&#39;, [&#39;jquery&#39;], function($) {
9 14 if(block_template && block_template.length > 0) {
10 15 $download_html_template = block_template;
11 16 } else {
12   - $.get('/plugin/software_communities/get_block_template', function(response) {
  17 + $.get(AJAX_URL.get_download_template, function(response) {
13 18 $download_html_template = response;
14 19 sessionStorage.setItem('download_list_block_template', response);
15 20 });
... ...