Changeset 1808 for ZMS/trunk/plugins


Ignore:
Timestamp:
06.02.2012 21:43:35 (4 months ago)
Author:
zmsdev
Message:

Ticket#27 (uni-bern): added support for manual setting of image-dimensions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/plugins/www/objattrs/zmi.blob.ZMSGraphic_extEdit.js

    r1803 r1808  
    237237 
    238238$(function () { 
     239        $("#ZMSGraphic_extEdit_width").keyup(function(){ 
     240                        var w = parseInt($(this).val()); 
     241                        if ($("#ZMSGraphic_extEdit_proportional").prop("checked")) { 
     242                                var v = w/ZMSGraphic_act_width; 
     243                                var h = Math.round(v*ZMSGraphic_act_height); 
     244                                $("#ZMSGraphic_extEdit_height").val(h); 
     245                        } 
     246                        var h = $("#ZMSGraphic_extEdit_height").val(); 
     247                        $ZMSGraphic_img.attr({'width':w,'height':h}); 
     248                }); 
     249        $("#ZMSGraphic_extEdit_height").keyup(function(){ 
     250                        var h = parseInt($(this).val()); 
     251                        if ($("#ZMSGraphic_extEdit_proportional").prop("checked")) { 
     252                                var v = h/ZMSGraphic_act_height; 
     253                                var w = Math.round(v*ZMSGraphic_act_width); 
     254                                $("#ZMSGraphic_extEdit_width").val(w); 
     255                        } 
     256                        var w = $("#ZMSGraphic_extEdit_width").val(); 
     257                        $ZMSGraphic_img.attr({'width':w,'height':h}); 
     258                }); 
    239259        $("#ZMSGraphic_extEdit_vslider").slider({ 
    240260                orientation: "vertical", 
Note: See TracChangeset for help on using the changeset viewer.