Files
OMS/app/desktop/view/finder/view/pager.html
2026-01-04 19:08:31 +08:00

89 lines
2.6 KiB
HTML

<!--
Copyright 2012-2026 ShopeX (https://www.shopex.cn)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<table>
<tfoot>
<tr>
<td>
<div class="clearfix">
<div class="flt"><span><{t}> 每页:<{/t}></span></div>
<div class="flt pointer finder-pageset" id="finder-pageset-<{$name}>">
<div class="finder-pageset-handle"></b><{$plimit}></b><{t}>条<{/t}></div>
<div id="finder-pagesel-<{$name}>" class="x-drop-menu" style="visibility:hidden;display:block">
<{$plimit_sel}>
</div>
</div>
</div>
</td>
<td>
<label for="finder-jumpinput-<{$name}>"><{t}> 前往<{/t}>
<input class="finder-page-input" type="text" style="width:20px; padding:0;border:1px #ccc solid;margin:0;font-size:12px; text-align: center" value="" id='finder-jumpinput-<{$name}>'/>
<{t}>页 <{/t}>
</label>
</td>
<{if $pager}>
<td style="text-align:center;">
<{$pager}>
</td>
<{/if}>
<td style="text-align:right;">
<{t}>共<{/t}><{$pinfo.count}><{t}>条<{/t}>
</td>
</tr>
</tfoot>
</table>
<script>
void function(){
var _h = $$('#finder-pageset-<{$name}> .finder-pageset-handle');
var _s = $('finder-pagesel-<{$name}>');
if(!_h[0]||!_s)return;
_h = _h[0];
$('finder-pageset-<{$name}>').addEvents({
'mouseenter':function(){
_h.addClass('active');
var _pos = _h.getPosition('workground');
_s.setStyles({
left:_pos.x+(Browser.firefox?1:0),
top:_pos.y - _s.getSize().y + (Browser.ie?4:1),
visibility:'visible'
});
},
'mouseleave':function(){
_h.removeClass('active');
_s.setStyle('visibility','hidden');
}
});
}();
<{if $pager}>
(function(){
var ipt=$('finder-jumpinput-<{$name}>');
var keyCodeFix=[13,48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105,8,9,46,37,39];
ipt.addEvent('keydown',function(e){
if(!keyCodeFix.contains(e.code)){e.stop();}
if(e.key=="enter"){<{$var_name}>.page(ipt.value);};
});
})();
<{/if}>
</script>