Ignore:
Timestamp:
Dec 29, 2013, 11:02:14 AM (10 years ago)
Author:
mistic100
Message:

hide NESW handles when forcing ratio

Location:
extensions/header_manager/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/header_manager/admin/add.php

    r26298 r26308  
    1313{
    1414  include_once(HEADER_MANAGER_PATH . 'include/banner.class.php');
     15 
     16  $conf['header_manager']['keep_ratio'] = isset($_POST['keep_ratio']);
     17  conf_update_param('header_manager', serialize($conf['header_manager']));
    1518 
    1619  $banner = get_banner($_POST['picture_file']);
     
    118121    'picture' => $picture,
    119122    'crop' => hm_get_crop_display($picture),
     123    'keep_ratio' => $conf['header_manager']['keep_ratio'],
    120124    ));
    121125}
  • extensions/header_manager/admin/template/add.tpl

    r26299 r26308  
    1717    boxHeight: {$crop.box_height},
    1818    trueSize: [{$picture.width}, {$picture.height}],
    19     aspectRatio: {$crop.real_width}/{$crop.real_height},
     19    {if $keep_ratio}aspectRatio: {$crop.real_width}/{$crop.real_height},{/if}
    2020    setSelect: [{$crop.l}, {$crop.t}, {$crop.r}, {$crop.b}],
    2121    onChange: function(sel) {
     
    3737  function() {
    3838    jcrop_api = this;
     39    {if $keep_ratio}jQuery(".jcrop-holder").addClass('fixed-ratio');{/if}
    3940  });
    4041 
     
    4647      jcrop_api.release();
    4748    }
     49    jQuery(".jcrop-holder").toggleClass('fixed-ratio');
    4850  });
    4951}());
     
    6062    <li><b>{'Width'|translate}:</b> <span id="width"></span>px</li>
    6163    <li><b>{'Height'|translate}:</b> <span id="height"></span>px</li>
    62     <li><label><input type="checkbox" name="keep_ratio" checked> {'Respect %s aspect ratio'|translate:($crop.desired_width|cat:'/'|cat:$crop.desired_height)}</label></li>
     64    <li><label><input type="checkbox" name="keep_ratio" {if $keep_ratio}checked{/if}> {'Respect %s aspect ratio'|translate:($crop.desired_width|cat:'/'|cat:$crop.desired_height)}</label></li>
    6365  </ul>
    6466 
  • extensions/header_manager/admin/template/style.css

    r24010 r26308  
    6262    vertical-align:middle;
    6363  }
     64 
     65.jcrop-holder.fixed-ratio .ord-s,
     66.jcrop-holder.fixed-ratio .ord-n,
     67.jcrop-holder.fixed-ratio .ord-e,
     68.jcrop-holder.fixed-ratio .ord-w {
     69  display:none;
     70}
Note: See TracChangeset for help on using the changeset viewer.