use template base url from initial template, to continue using webdav, if that was loaded via webdav

This commit is contained in:
Ralf Becker 2014-11-05 13:07:13 +00:00
parent 123bb043d5
commit 026e93a0c4
2 changed files with 4 additions and 1 deletions

View File

@ -103,7 +103,8 @@ var et2_template = et2_DOMWidget.extend(
{
// Ask server
var splitted = template_name.split('.');
var path = this.egw().webserverUrl + "/" + splitted.shift() + "/templates/default/" +
// use template base url from initial template, to continue using webdav, if that was loaded via webdav
var path = this.getRoot()._inst.template_base_url + splitted.shift() + "/templates/default/" +
splitted.join('.')+ ".xet" + (cache_buster ? '?'+cache_buster : '');
if(splitted.length)

View File

@ -273,6 +273,8 @@ etemplate2.prototype.download = function(_url)
etemplate2.prototype.load = function(_name, _url, _data, _callback)
{
this.name = _name; // store top-level template name to have it available in widgets
// store template base url, in case initial template is loaded via webdav, to use that for further loads too
this.template_base_url = _url.split(_name.split('.').shift())[0];
egw().debug("info", "Loaded data", _data);
var currentapp = this.app = _data.currentapp || window.egw_appName;