Sha256: f411b3c80f3b179b4d8a13ed472096be3624bbb1877730864d2c157744846fb8

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

(function() {
  Rev.registerComponent('RouterLink', {
    render: function() {
      return React.createElement("a", React.__spread({
        "onClick": this.onClick
      }, this.props), this.props.children);
    },
    onClick: function(e) {
      if (this.hasMatch()) {
        e.preventDefault();
        Backbone.history.navigate(Backbone.history.fragment, {
          trigger: false
        });
        Backbone.history.navigate(this.props.href, {
          trigger: true
        });
      }
      return true;
    },
    bbNormalHref: function() {
      if (this.props.href[0] === '/') {
        return this.props.href.slice(1);
      } else {
        return this.props.href(end);
      }
    },
    hasMatch: function() {
      if (this.props.href != null) {
        return _(Backbone.history.handlers).any((function(_this) {
          return function(handler) {
            return handler.route.test(_this.bbNormalHref());
          };
        })(this));
      } else {
        return false;
      }
    }
  });

}).call(this);

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
revelry_core-0.1.12.4 spec/dummy/tmp/jasmine/assets/revelry/router/routerlink.self.js
revelry_core-0.1.12.2 spec/dummy/tmp/jasmine/assets/revelry/router/routerlink.self.js
revelry_core-0.1.11.6 spec/dummy/tmp/jasmine/assets/revelry/router/routerlink.self.js
revelry_core-0.1.10.1 spec/dummy/tmp/jasmine/assets/revelry/router/routerlink.self.js
revelry_core-0.1.10.0 spec/dummy/tmp/jasmine/assets/revelry/router/routerlink.self.js
revelry_core-0.1.9.1 spec/dummy/tmp/jasmine/assets/revelry/router/routerlink.self.js
revelry_core-0.1.9.0 spec/dummy/tmp/jasmine/assets/revelry/router/routerlink.self.js
revelry_core-0.1.8.0 spec/dummy/tmp/jasmine/assets/revelry/router/routerlink.self.js