Sha256: 75a805cabd03fc31fc2de2ebf6a02374875e0f7bd6c68b64fb1aaa14183d4e83

Contents?: true

Size: 559 Bytes

Versions: 7

Compression:

Stored size: 559 Bytes

Contents

$.fn.linkmapAreaContains = function(position) {
  var area = $(this);
  var mask = area.data('mask');

  if (mask) {
    return mask.contains(position.leftInPercent / 100, position.topInPercent / 100);
  }
  else {
    var areaPosition = area.position();
    var areaWidth = area.width();
    var areaHeight = area.height();

    return position.leftInPixel >= areaPosition.left &&
      position.leftInPixel < areaPosition.left + areaWidth &&
      position.topInPixel >= areaPosition.top &&
      position.topInPixel < areaPosition.top + areaHeight;
  }
};

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pageflow-linkmap-page-1.5.0 app/assets/javascript/pageflow/linkmap_page/widgets/linkmap/area_contains.js
pageflow-linkmap-page-1.4.0 app/assets/javascript/pageflow/linkmap_page/widgets/linkmap/area_contains.js
pageflow-linkmap-page-1.3.0 app/assets/javascript/pageflow/linkmap_page/widgets/linkmap/area_contains.js
pageflow-linkmap-page-1.2.1 app/assets/javascript/pageflow/linkmap_page/widgets/linkmap/area_contains.js
pageflow-linkmap-page-1.2.0 app/assets/javascript/pageflow/linkmap_page/widgets/linkmap/area_contains.js
pageflow-linkmap-page-1.1.0 app/assets/javascript/pageflow/linkmap_page/widgets/linkmap/area_contains.js
pageflow-linkmap-page-1.0.0 app/assets/javascript/pageflow/linkmap_page/widgets/linkmap/area_contains.js