thumbnail button inside map info box
This commit is contained in:
parent
4c53dcce3d
commit
ccf9353d9d
3 changed files with 15 additions and 5 deletions
|
@ -34,6 +34,10 @@
|
||||||
<p class="mapCreatedAt"><span>Created by:</span> {{user_name}} on {{created_at}}</p>
|
<p class="mapCreatedAt"><span>Created by:</span> {{user_name}} on {{created_at}}</p>
|
||||||
<p class="mapEditedAt"><span>Last edited:</span> {{updated_at}}</p>
|
<p class="mapEditedAt"><span>Last edited:</span> {{updated_at}}</p>
|
||||||
<div class="mapInfoButtonsWrapper">
|
<div class="mapInfoButtonsWrapper">
|
||||||
|
<div class="mapInfoThumbnail">
|
||||||
|
<div class="thumbnail"></div>
|
||||||
|
<span>Update Thumbnail</span>
|
||||||
|
</div>
|
||||||
<div class="mapInfoDelete">
|
<div class="mapInfoDelete">
|
||||||
<div class="deleteMap"></div>
|
<div class="deleteMap"></div>
|
||||||
<span>Delete</span>
|
<span>Delete</span>
|
||||||
|
|
|
@ -35,9 +35,11 @@ const InfoBox = {
|
||||||
data-bip-value="{{desc}}"
|
data-bip-value="{{desc}}"
|
||||||
>{{desc}}</span>`,
|
>{{desc}}</span>`,
|
||||||
userImageUrl: '',
|
userImageUrl: '',
|
||||||
init: function(serverData) {
|
init: function(serverData, updateThumbnail) {
|
||||||
var self = InfoBox
|
var self = InfoBox
|
||||||
|
|
||||||
|
self.updateThumbnail = updateThumbnail
|
||||||
|
|
||||||
$('.mapInfoIcon').click(self.toggleBox)
|
$('.mapInfoIcon').click(self.toggleBox)
|
||||||
$('.mapInfoBox').click(function(event) {
|
$('.mapInfoBox').click(function(event) {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
@ -181,6 +183,7 @@ const InfoBox = {
|
||||||
$('.mapInfoBox.yourMap').unbind('.yourMap').bind('click.yourMap', self.hidePermissionSelect)
|
$('.mapInfoBox.yourMap').unbind('.yourMap').bind('click.yourMap', self.hidePermissionSelect)
|
||||||
|
|
||||||
$('.yourMap .mapInfoDelete').unbind().click(self.deleteActiveMap)
|
$('.yourMap .mapInfoDelete').unbind().click(self.deleteActiveMap)
|
||||||
|
$('.mapInfoThumbnail').unbind().click(self.updateThumbnail)
|
||||||
|
|
||||||
$('.mapContributors span, #mapContribs').unbind().click(function(event) {
|
$('.mapContributors span, #mapContribs').unbind().click(function(event) {
|
||||||
$('.mapContributors .tip').toggle()
|
$('.mapContributors .tip').toggle()
|
||||||
|
|
|
@ -45,7 +45,10 @@ const Map = {
|
||||||
GlobalUI.CreateMap.emptyForkMapForm = $('#fork_map').html()
|
GlobalUI.CreateMap.emptyForkMapForm = $('#fork_map').html()
|
||||||
|
|
||||||
self.updateStar()
|
self.updateStar()
|
||||||
InfoBox.init(serverData)
|
|
||||||
|
InfoBox.init(serverData, function updateThumbnail() {
|
||||||
|
self.uploadMapScreenshot()
|
||||||
|
})
|
||||||
CheatSheet.init(serverData)
|
CheatSheet.init(serverData)
|
||||||
|
|
||||||
$('.viewOnly .requestAccess').click(self.requestAccess)
|
$('.viewOnly .requestAccess').click(self.requestAccess)
|
||||||
|
@ -251,8 +254,8 @@ const Map = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
exportImage: function() {
|
exportImage: function() {
|
||||||
Map.offerScreenshotDownload()
|
|
||||||
Map.uploadMapScreenshot()
|
Map.uploadMapScreenshot()
|
||||||
|
Map.offerScreenshotDownload()
|
||||||
},
|
},
|
||||||
offerScreenshotDownload: () => {
|
offerScreenshotDownload: () => {
|
||||||
const canvas = Map.getMapCanvasForScreenshots()
|
const canvas = Map.getMapCanvasForScreenshots()
|
||||||
|
@ -278,10 +281,10 @@ const Map = {
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
console.log('successfully uploaded map screenshot')
|
GlobalUI.notifyUser('Successfully updated map screenshot.')
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
console.log('failed to save map screenshot')
|
GlobalUI.notifyUser('Failed to update map screenshot.')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue