Sha256: 7e093a019251ceb4f920a5061bbf52ae94e277659995e61ad15a8b95f1d2193d

Contents?: true

Size: 518 Bytes

Versions: 7

Compression:

Stored size: 518 Bytes

Contents

"use strict";

define(['flight/lib/component'], function(defineComponent){

  return defineComponent(posts);

  function posts(){

    this.defaultAttrs({
      postSelector: ".post"
    });

    this.visitPost = function(e){
      e.preventDefault();
      var url = $(e.target).attr("href");
      history.pushState(null, "Post", url);
      $(document).trigger("postChosen");
    };

    this.after("initialize", function(){
      this.on("click", {
        postSelector: this.visitPost
      });
    });

  }

});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
half-pipe-0.3.0.alpha.1 examples/rails/app/scripts/features/posts.js
half-pipe-0.2.4 examples/rails/app/scripts/features/posts.js
half-pipe-0.2.3 examples/rails/app/scripts/features/posts.js
half-pipe-0.2.2 examples/rails/app/scripts/features/posts.js
half-pipe-0.2.1 examples/rails/app/scripts/features/posts.js
half-pipe-0.2.0 examples/rails/app/scripts/features/posts.js
half-pipe-0.1.0 examples/rails/app/scripts/features/posts.js