Skip to content

Commit

Permalink
V1.1.1, issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory L'Azou committed Oct 14, 2014
1 parent be90676 commit ce1be3e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Storymaps-MapJournal",
"version": "1.1.0",
"version": "1.1.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/storymaps/tpl/core/MainView.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ define(["lib-build/css!./MainView",
else {
var handle, handle2;

handle = topic.subscribe("story-loaded-section", function(){
handle = topic.subscribe("story-loaded-map", function(){
handle.remove();
handle2.remove();

Expand Down
17 changes: 14 additions & 3 deletions src/app/storymaps/tpl/ui/MainStage.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ define(["lib-build/tpl!./MainMediaContainerMap",
var section = app.data.getStoryByIndex(index);
if ( section && section.media )
updateMainMedia(section.media, section, index);

topic.publish("story-load-section", index);
};

this.updateMainMediaWithStoryAction = function(media)
Expand Down Expand Up @@ -429,7 +431,10 @@ define(["lib-build/tpl!./MainMediaContainerMap",
mapContainer.parent().addClass("has-error");
mapContainer.parent().find('.error').html(i18n.viewer.errors.mapLoadingFail);

topic.publish("story-loaded-section", index);
topic.publish("story-loaded-map", {
id: newWebmapId,
index: index
});
topic.publish("ADDEDIT_LOAD_WEBMAP_FAIL");
})
);
Expand Down Expand Up @@ -514,10 +519,16 @@ define(["lib-build/tpl!./MainMediaContainerMap",
if ( extent )
app.map.setExtent(extent/*, true*/).then(function(){
applyPopupConfiguration(media.webmap.popup, index);
topic.publish("story-loaded-section", index);
topic.publish("story-loaded-map", {
id: media.webmap.id,
index: index
});
}); // TODO has at least to use _core.setExtent
else
topic.publish("story-loaded-section", index);
topic.publish("story-loaded-map", {
id: media.webmap.id,
index: index
});

/*
// Reuse the current extent
Expand Down
4 changes: 2 additions & 2 deletions src/app/storymaps/tpl/ui/StoryText.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ define(["dojo/topic",
// If the action is only changing extent on the same map, the next Map Move discard the back button
// Can't rely on update-end as the Map may fire more than one event depending
// on the extent. As of 3.11, zoom far away is ok, but simple pan fire multiple events.
// so wait for story-loaded-section which is fired on setExtent.then and after a timeout we can
// so wait for story-loaded-map which is fired on setExtent.then and after a timeout we can
// safely listen for update-end
if ( actionChangeExtent && ! actionChangeLayers && ! actionChangePopup && currentWebmapId == action.media.webmap.id ) {
var handle = topic.subscribe("story-loaded-section", function(){
var handle = topic.subscribe("story-loaded-map", function(){
handle.remove();

setTimeout(function(){
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<script type="text/javascript">
var app = {
version: '1.1.0',
version: '1.1.1',
pathJSAPI: '//js.arcgis.com/3.11/'
};
</script>
Expand Down

0 comments on commit ce1be3e

Please sign in to comment.