Improved path support

This commit is contained in:
Maurits van der Schee 2016-04-12 00:18:06 +02:00
commit 64525b55eb
2 changed files with 2 additions and 2 deletions

View file

@ -1,4 +1,4 @@
w3component.components['w3component/post-list'] = function (element, template) {
w3component.components['post-list'] = function (element, template) {
var self = this;
var url = '../api.php/posts';
self.edit = function() {

View file

@ -11,7 +11,7 @@ var w3component = $(function(){
$.ajax({dataType:'text', url: name+'.html',success:function(template){
$('<script>').attr('src',name+'.js').appendTo('body').on('load',function(){
$(['div.w3component[w3component="'+name+'"]']).each(function(){
self.components[name]($(this),template);
self.components[name.split('/').pop()]($(this),template);
});
});
}});