Skip to content

Commit

Permalink
fix(datagrid): fix zoom back after zoom to
Browse files Browse the repository at this point in the history
  • Loading branch information
cynngah committed May 14, 2015
1 parent 06026b1 commit e1c8850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/js/RAMP/Modules/datagrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,25 +594,27 @@ define([
// Update "zoom back" text after the extent change, if we update it
// before the extent change, it won't work since the datagrid gets
// repopulated after an extent change
utilMisc.subscribeOnce(EventManager.Datagrid.EXTENT_FILTER_END, function () {
utilMisc.subscribe(EventManager.Datagrid.EXTENT_FILTER_END, function () {
// Find the first node with the same oid, layerId
var newNode = $(String.format("button.zoomto[data-{0}='{1}'][data-{2}='{3}']:eq(0)",
featureOidField, GraphicExtension.getFDataOid(fData),
layerIdField, fData.parent.layerId));
// Change node's text to Zoom Back
newNode.text(i18n.t("datagrid.zoomBack"));
});
});
} else { // Zoom back
DatagridClickHandler.onZoomBack();
zoomNode.text(i18n.t("datagrid.zoomTo"));

// Reset focus back to "Zoom To" link after map extent change
utilMisc.subscribeOnce(EventManager.Datagrid.EXTENT_FILTER_END, function () {
utilMisc.subscribe(EventManager.Datagrid.EXTENT_FILTER_END, function () {
var newNode = $(String.format("button.zoomto[data-{0}='{1}'][data-{2}='{3}']:eq(0)",
featureOidField, GraphicExtension.getFDataOid(fData),
layerIdField, fData.parent.layerId));
// Change node's text back to Zoom To
newNode.text(i18n.t("datagrid.zoomTo"));
newNode.focus();
});
zoomNode.text(i18n.t("datagrid.zoomTo"));
}
});

Expand Down
1 change: 0 additions & 1 deletion src/js/RAMP/Modules/datagridClickHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ define([
});
break;
}

topic.publish(EventManager.Datagrid.ZOOMLIGHTROW_SHOW, {
fData: fData
});
Expand Down

0 comments on commit e1c8850

Please sign in to comment.