Browse Source

Improve bookmarklet form

tags/v1.0.0
Isaac Bythewood 11 years ago
parent
commit
dedf33183b
3 changed files with 21 additions and 5 deletions
  1. +4
    -0
      pinry/static/css/pinry.css
  2. +2
    -2
      pinry/static/js/bookmarklet.js
  3. +15
    -3
      pinry/static/js/pin-form.js

+ 4
- 0
pinry/static/css/pinry.css View File

@@ -116,6 +116,10 @@ textarea {
.qq-upload-spinner {
display: none;
}

.modal-body {
overflow: hidden;
}
/* End Forms */




+ 2
- 2
pinry/static/js/bookmarklet.js View File

@@ -60,7 +60,7 @@ $(document).ready(function() {
$(pinryBar).css({
'background': 'black',
'padding': '15px',
'position': 'fixed',
'position': 'absolute',
'z-index': '9002',
'width': '100%',
'top': 0,
@@ -91,7 +91,7 @@ $(document).ready(function() {
});
$(image).click(function() {
var popUrl = getFormUrl()+imageUrl;
window.open(popUrl, '', 'width=590,height=439,toolbar=0,menubar=0');
window.open(popUrl);
$('#pinry-images').remove();
});
return $('#pinry-images').append(image);


+ 15
- 3
pinry/static/js/pin-form.js View File

@@ -34,9 +34,17 @@ $(window).load(function() {
preview.find('.pin').width(200);
preview.find('.pin .text').width(140);
preview.find('.pin').fadeIn(300);
if (getFormData().url == "")
preview.find('.image-wrapper').height(278);
preview.find('.image-wrapper img').fadeIn(300);
if (preview.find('.pin').height() > 305)
$('#pin-form .modal-body').height(preview.find('.pin').height());
console.log(preview.find('.pin').height());
setTimeout(function() {
if (preview.find('.pin').height() > 305) {
$('#pin-form .modal-body').animate({
'height': preview.find('.pin').height()
}, 300);
}
}, 300);
}

function dismissModal(modal) {
@@ -57,9 +65,13 @@ $(window).load(function() {
pinFromUrl = getUrlParameter('pin-image-url');
modal.modal('show');
// Auto update preview on field changes
var timer;
for (var i in formFields) {
formFields[i].bind('propertychange keyup input paste', function() {
createPinPreviewFromForm();
clearTimeout(timer);
timer = setTimeout(function() {
createPinPreviewFromForm()
}, 700);
if (!uploadedImage)
$('#pin-form-image-upload').parent().parent().fadeOut(300);
});


Loading…
Cancel
Save