Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue 2734 where export file formats were showing up for mbti… #2735

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions templates/Metadata._
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var get = _(project.get).bind(project);
<small class='dependent description help'>Enter a <a target='_blank' href="https://github.com/mapnik/mapnik/wiki/Image-IO">custom Mapnik format string</a>.</small>
</li>
<% } %>
<% if (model !== project && model.get('format') !== 'sync') { %>
<% if (type === 'image') { %>
<li>
<label for='exportFormat'>File Format</label>
<select name="exportFormat" class="exportformat-selection" style='width:unset' >
Expand All @@ -74,6 +74,8 @@ var get = _(project.get).bind(project);
<option value="SVG"<% if (model.get('format') == 'svg') { %> selected='selected' <% } %>>SVG</option>
</select>
</li>
<% } %>
<% if (model !== project && model.get('format') !== 'sync') { %>
<li>
<label>Filename</label>
<% if (model.get('filename')) { %>
Expand Down Expand Up @@ -128,13 +130,15 @@ var get = _(project.get).bind(project);
</span>
</div>
</li>
<li>
<label>Aspect Ratio</label>
<input name='aspectwidth' type='text' value='<% if (model.get('aspectwidth') !== undefined) { %><%=model.get('aspectwidth')%><% } else { %>8.5<% } %>' size='4' disabled /> :
<input name='aspectheight' type='text' value='<% if (model.get('aspectheight') !== undefined) { %><%=model.get('aspectheight')%><% } else { %>11<% } %>' size='4' disabled />
<input type='checkbox' name='setaspect' value='1'/><small> lock</small>
<small class='description'>Any units - lock to edit</small>
</li>
<div id="aspect-ratio-fields">
<li>
<label>Aspect Ratio</label>
<input name='aspectwidth' type='text' value='<% if (model.get('aspectwidth') !== undefined) { %><%=model.get('aspectwidth')%><% } else { %>8.5<% } %>' size='4' disabled /> :
<input name='aspectheight' type='text' value='<% if (model.get('aspectheight') !== undefined) { %><%=model.get('aspectheight')%><% } else { %>11<% } %>' size='4' disabled />
<input type='checkbox' name='setaspect' value='1'/><small> lock</small>
<small class='description'>Any units - lock to edit</small>
</li>
</div>
<% if (type === 'image') { %>
<li>
<label>Scale</label><small>1:</small>
Expand Down
4 changes: 4 additions & 0 deletions views/Metadata.bones
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ view.prototype.render = function() {
width: "120px"
});

// Hide the aspect ratio fields for mbtiles exports.
if (this.model.get('format') === 'mbtiles')
this.$('div[id=aspect-ratio-fields]')[0].setAttribute('hidden',true);

return this;
};

Expand Down