Преглед изворни кода

don't wipe out custom entry after the location-specific buttons load

pull/10/head
Aaron Parecki пре 9 година
родитељ
комит
b869090f78
2 измењених фајлова са 22 додато и 1 уклоњено
  1. +21
    -0
      views/new-post.php
  2. +1
    -1
      views/partials/entry-buttons.php

+ 21
- 0
views/new-post.php Прегледај датотеку

@ -98,7 +98,28 @@ $(function(){
latitude: position.coords.latitude,
longitude: position.coords.longitude
}, function(response) {
// save and restore the value entered in the custom fields
var custom_eat = $('#custom_eat').val();
var custom_drink = $('#custom_drink').val();
var selected = false;
if($("#custom_drink:focus").length == 1) {
selected = '#custom_drink';
}
if($("#custom_eat:focus").length == 1) {
selected = '#custom_eat';
}
$("#entry-buttons").html(response);
// restore the custom values entered
$('#custom_eat').val(custom_eat);
$('#custom_drink').val(custom_drink);
if(selected) {
$(selected).focus();
}
bind_keyboard_shortcuts();
});

+ 1
- 1
views/partials/entry-buttons.php Прегледај датотеку

@ -18,7 +18,7 @@
}
if($type == 'drink' || $type == 'eat') {
echo '<li>';
echo '<input type="text" class="form-control text-custom-'.$type.'" name="custom_'.$type.'" placeholder="Custom '.$noun.'" style="width: 72%; float: left; margin-right: 2px;">';
echo '<input type="text" class="form-control text-custom-'.$type.'" id="custom_'.$type.'" name="custom_'.$type.'" placeholder="Custom '.$noun.'" style="width: 72%; float: left; margin-right: 2px;">';
echo '<input type="submit" class="btn btn-default btn-custom-'.$type.'" value="Post" style="width: 26%; float: right;">';
echo '<div style="clear:both;"></div>';
echo '</li>';

Loading…
Откажи
Сачувај