Sha256: d7f1943fa84d532ae0b18bd2af49dfb6cd7039033826dec45acfc5c623f07114

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

// 
// Discussion
// 
Rad.Discussion = new Class({
  anew: function(formQ){
    this._buildInplace().edit(formQ);
  },
  create: function(contentQ){
    this._buildInplace().update(contentQ);
  },  
  _buildInplace: function(){
    var inplace = new Rad.AddInplace('.the_discussion .l_comments');
    var control = '.the_discussion .l_controls'.toElements();
    inplace.addEvents({
      edit: control.hide.bind(control),
      update: control.show.bind(control),
      destroy: control.show.bind(control)
    });
    return inplace;
  },
  comment: function(commentQ){
    return new Rad.Comment(this, commentQ);
  }
});


// 
// Comments
// 
Rad.Comment = new Class({
  initialize: function(discussion, commentQ){
    this.discussion = discussion;
    this.comment = commentQ.toElement(true);
  },
  destroy: function(){
    this.comment.destroy();
  },
  update: function(contentQ){
    this._buildInplace().update(contentQ);
  },
  edit: function(formQ){
    this._buildInplace().edit(formQ);
  },
  _buildInplace: function(){
    return new Rad.EditInplace(this.comment);
  },
});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rad_common_interface-0.0.14 app/static/face/discussion.js
rad_common_interface-0.0.13 app/static/face/discussion.js
rad_common_interface-0.0.12 app/static/face/discussion.js
rad_common_interface-0.0.11 app/static/face/discussion.js
rad_common_interface-0.0.10 app/static/face/discussion.js
rad_common_interface-0.0.9 app/static/face/discussion.js
rad_common_interface-0.0.8 app/static/face/discussion.js
rad_common_interface-0.0.7 app/static/face/discussion.js