added limit methods to user, more work on post views
This commit is contained in:
13
public/javascripts/src/uploads/new.js
Normal file
13
public/javascripts/src/uploads/new.js
Normal file
@@ -0,0 +1,13 @@
|
||||
$(document).ready(function() {
|
||||
var img = $("#image-preview img");
|
||||
if (img) {
|
||||
var height = img.attr("height");
|
||||
var width = img.attr("width");
|
||||
if (height > 400) {
|
||||
var ratio = 400.0 / height;
|
||||
img.attr("height", height * ratio);
|
||||
img.attr("width", width * ratio);
|
||||
$("#scale").val("Scaled " + parseInt(100 * ratio) + "%");
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user