handle_pixel -> shm-*
This commit is contained in:
parent
f5d787efbf
commit
4470d937a4
3 changed files with 6 additions and 6 deletions
|
@ -73,7 +73,7 @@ class PixelFileHandler extends DataHandlerExtension {
|
|||
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) {
|
||||
$event->add_part("
|
||||
<form>
|
||||
<select id='zoomer'>
|
||||
<select class='shm-zoomer'>
|
||||
<option value='full'>Full Size</option>
|
||||
<option value='width'>Fit Width</option>
|
||||
<option value='height'>Fit Height</option>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
$(function() {
|
||||
$("#zoomer").change(function(e) {
|
||||
$(".shm-zoomer").change(function(e) {
|
||||
zoom(this.options[this.selectedIndex].value);
|
||||
});
|
||||
|
||||
$("#main_image").click(function(e) {
|
||||
$(".shm-main-image").click(function(e) {
|
||||
switch($.cookie("ui-image-zoom")) {
|
||||
case "full": zoom("width"); break;
|
||||
default: zoom("full"); break;
|
||||
|
@ -16,7 +16,7 @@ $(function() {
|
|||
});
|
||||
|
||||
function zoom(zoom) {
|
||||
var img = $('#main_image');
|
||||
var img = $('.shm-main-image');
|
||||
if(zoom == "full") {
|
||||
img.css('max-width', img.data('width') + 'px');
|
||||
img.css('max-height', img.data('height') + 'px');
|
||||
|
@ -34,7 +34,7 @@ function zoom(zoom) {
|
|||
img.css('max-height', (window.innerHeight * 0.95) + 'px');
|
||||
}
|
||||
|
||||
$("#zoomer").val(zoom);
|
||||
$(".shm-zoomer").val(zoom);
|
||||
|
||||
$.cookie("ui-image-zoom", zoom, {path: '/', expires: 365});
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class PixelFileHandlerTheme extends Themelet {
|
|||
}
|
||||
}
|
||||
|
||||
$html = "<img alt='main image' id='main_image' src='$u_ilink' data-width='{$image->width}' data-height='{$image->height}'>";
|
||||
$html = "<img alt='main image' class='shm-main-image' id='main_image' src='$u_ilink' data-width='{$image->width}' data-height='{$image->height}'>";
|
||||
$page->add_block(new Block("Image", $html, "main", 10));
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue