Sha256: b91c101a91a0626114d3baae9495761653b3aa55ce6ca4778075250372336257

Contents?: true

Size: 672 Bytes

Versions: 16

Compression:

Stored size: 672 Bytes

Contents

$(function() {
  var keycodes = { space: 32, enter: 13 };

  var visitDataUrl = function(event) {
    if (event.type == "click" ||
        event.keyCode == keycodes.space ||
        event.keyCode == keycodes.enter) {

      if (event.target.href) {
        return;
      }

      var dataUrl = $(event.target).closest("tr").data("url");
      var selection = window.getSelection().toString();
      if (selection.length === 0 && dataUrl) {
        window.location = window.location.protocol + '//' + window.location.host + dataUrl;
      }
    }
  };

  $("table").on("click", ".js-table-row", visitDataUrl);
  $("table").on("keydown", ".js-table-row", visitDataUrl);
});

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
administrate-1.0.0.beta1 app/assets/javascripts/administrate/components/table.js
administrate-0.20.1 app/assets/javascripts/administrate/components/table.js
administrate-0.20.0 app/assets/javascripts/administrate/components/table.js
administrate-0.19.0 app/assets/javascripts/administrate/components/table.js
administrate-0.18.0 app/assets/javascripts/administrate/components/table.js
administrate-0.17.0 app/assets/javascripts/administrate/components/table.js
administrate-0.16.0 app/assets/javascripts/administrate/components/table.js
administrate-0.15.0 app/assets/javascripts/administrate/components/table.js
administrate-0.14.0 app/assets/javascripts/administrate/components/table.js
viniBaxterDesk-22.0.0 app/assets/javascripts/administrate/components/table.js
viniBaxterDesk-0.21.0 app/assets/javascripts/administrate/components/table.js
viniBaxterDesk-0.20.0 app/assets/javascripts/administrate/components/table.js
viniBaxterDesk-0.14.0 app/assets/javascripts/administrate/components/table.js
viniBaxterDesk-0.13.2 app/assets/javascripts/administrate/components/table.js
viniBaxterDesk-0.13.1 app/assets/javascripts/administrate/components/table.js
administrate-0.13.0 app/assets/javascripts/administrate/components/table.js