Skip to content

Instantly share code, notes, and snippets.

@dbarrionuevo
Created December 23, 2014 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbarrionuevo/7afd627fa774785924db to your computer and use it in GitHub Desktop.
Save dbarrionuevo/7afd627fa774785924db to your computer and use it in GitHub Desktop.
// Not implemented yet!
(function($) {
"use strict"
youconnect.behaviors.in_a_future_release = function(container) {
var behavior = {
init: function() {
behavior.addClickListener();
},
addClickListener: function() {
container.on("click", function(e) {
var message = container.data('message');
alert(message);
});
}
};
behavior.init();
}
})(jQuery)
@roperzh
Copy link

roperzh commented Dec 23, 2014

YouConnect.Behaviors.InAFutureRelease = Essential.Behavior.extend({
  init: function() {
    this.message = container.data('message');
  },

  events: {
    'click': 'sendMessage'
  },

  sendMessage: function() {
    alert(this.message);
  }
});

@roperzh
Copy link

roperzh commented Dec 23, 2014

YouConnect.Behaviors.ErrorsManager = Essential.Behavior.extend({
  init: function() {
    this.message = container.data('message');
  },

  events: {
    'click': 'sendMessage'
  }
});

YouConnect.Behaviors.AlertMessager = YouConnect.Behaviors.ErrorsManager.extend({
  sendMessage: function() {
    alert(this.message);
  }
});

YouConnect.Behaviors.ConsoleMessager = YouConnect.Behaviors.ErrorsManager.extend({
  sendMessage: function() {
    console.log(this.message);
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment