Commit ff6d949f authored by Georgios Tsakalos's avatar Georgios Tsakalos

add remove software function in js

parent 39d242de
...@@ -112,7 +112,6 @@ ...@@ -112,7 +112,6 @@
_.each(this.form[0].elements, function (element) { _.each(this.form[0].elements, function (element) {
var element = $(element), var element = $(element),
name = element.attr('name'); name = element.attr('name');
//if ('checkbox')
element.val(softwareAttributes[name] || ''); element.val(softwareAttributes[name] || '');
}); });
this.show(); this.show();
...@@ -143,8 +142,22 @@ ...@@ -143,8 +142,22 @@
} }
}); });
}, },
removeSoftware: function () {
var that = this;
$.ajax({
url: that.url,
type: 'delete',
data: {
'id': that.software.get('id')
}
}).done(function () {
that.model.remove(that.sowftare.get('id'));
that.hide();
}).fail(function(xhr, err){
});
}
}); });
new SoftwareCollectionView({model: new SoftwareCollection() }); new SoftwareCollectionView({model: new SoftwareCollection() });
}(window.EDULABS.utils)); }(window.EDULABS.utils));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment