Use the jQuery data() function to access HTML 5 data attributes
This commit is contained in:
parent
7af04f8691
commit
d76aa13ddd
2 changed files with 4 additions and 6 deletions
|
@ -8,12 +8,10 @@ $(document).ready(function () {
|
|||
mapZoom = map.getZoom();
|
||||
|
||||
$(".mapkey-table-entry").each(function () {
|
||||
var entryLayer = $(this).attr("data-layer"),
|
||||
entryZoomMin = parseInt($(this).attr("data-zoom-min")),
|
||||
entryZoomMax = parseInt($(this).attr("data-zoom-max"));
|
||||
var data = $(this).data();
|
||||
|
||||
if (mapLayer == entryLayer &&
|
||||
mapZoom >= entryZoomMin && mapZoom <= entryZoomMax) {
|
||||
if (mapLayer == data.layer &&
|
||||
mapZoom >= data.zoomMin && mapZoom <= data.zoomMax) {
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
|
|
|
@ -49,7 +49,7 @@ $(document).ready(function () {
|
|||
preview.addClass("loading");
|
||||
});
|
||||
|
||||
preview.load(editor.attr("data-preview-url"), { text: editor.val() }, function () {
|
||||
preview.load(editor.data("previewUrl"), { text: editor.val() }, function () {
|
||||
preview.stopTime("loading");
|
||||
preview.removeClass("loading");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue