Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. // Modelo genérico
  2. // herencia con riotjs
  3. function AjaxModel(url) {
  4. riot.observable(this);
  5. this.url = url;
  6. };
  7.  
  8. /**
  9. * Class
  10. */
  11. function cur_item(url) {
  12. this.url = url;
  13. console.log('init constructor URL', url);
  14. }
  15.  
  16. cur_item.prototype = new AjaxModel(cur_item.url);
  17.  
  18. // Events
  19. cur_item.prototype.on('updated', function(status) {
  20. console.log('event updated');
  21. env['tag-inspector'].trigger('mostrarDatos', env.cur_item);
  22. });
  23.  
  24. // Functions
  25. cur_item.prototype.abrirInspector = function(event, url) {
  26. console.log("dd")
  27. this.load(url).then(function(event) {
  28. env['tag-inspector'].mostrarVentana(event);
  29. });
  30. };
  31.  
  32. cur_item.prototype.saludar = function() {
  33. console.log ("hi! cur_item")
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement