mobileclient share integration
This commit is contained in:
parent
680928e093
commit
e9f01e7c0b
3 changed files with 19 additions and 1 deletions
|
@ -767,6 +767,12 @@ main:not([data-view=route-result]) #route-summary {
|
|||
.share-ui input {
|
||||
margin: 0;
|
||||
}
|
||||
.share-ui p button {
|
||||
margin: 10px 0 0;
|
||||
}
|
||||
body:not(.mobileclient) .share-ui p {
|
||||
display: none;
|
||||
}
|
||||
main > .share-ui {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -100,6 +100,8 @@ c3nav = {
|
|||
$('#modal').on('click', c3nav._modal_click)
|
||||
.on('click', 'a', c3nav._modal_link_click)
|
||||
.on('submit', 'form', c3nav._modal_submit);
|
||||
.on('click', '.mobileclient-share', c3nav._mobileclient_share_click)
|
||||
.on('click', '.mobileclient-shortcut', c3nav._mobileclient_shortcut_click)
|
||||
$('header #user').on('click', c3nav._modal_link_click);
|
||||
|
||||
$('header h1 a').removeAttr('href');
|
||||
|
@ -628,7 +630,7 @@ c3nav = {
|
|||
c3nav._update_share_ui();
|
||||
},
|
||||
_update_share_ui: function(with_position) {
|
||||
var $share = $('#modal .share-ui'),
|
||||
var $share = $('#modal').find('.share-ui'),
|
||||
state = $.extend({}, c3nav.state),
|
||||
url;
|
||||
if (!with_position) {
|
||||
|
@ -639,6 +641,12 @@ c3nav = {
|
|||
$share.find('input').val(window.location.protocol + '//' + window.location.host + url);
|
||||
if (!window.mobileclient) $share.find('input')[0].select();
|
||||
},
|
||||
_mobileclient_share_click: function() {
|
||||
mobileclient.shareUrl($('#modal').find('.share-ui input').val());
|
||||
},
|
||||
_mobileclient_shortcut_click: function() {
|
||||
mobileclient.createShortcut($('#modal').find('.share-ui input').val(), c3nav.state.destination.title);
|
||||
},
|
||||
|
||||
// location inputs
|
||||
locations: [],
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
<h3>Share</h3>
|
||||
<img src="">
|
||||
<input type="text" readonly>
|
||||
<p>
|
||||
<button class="mobileclient-share">{% trans 'share' %}</button>
|
||||
<button class="mobileclient-shortcut">{% trans 'create shortcut' %}</button>
|
||||
</p>
|
||||
</section>
|
||||
<section id="sidebar">
|
||||
<section id="search" class="loading">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue