1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

disable backgruond image selection and dragging

This commit is contained in:
Lu Wang 2013-03-01 14:02:11 +08:00
parent 34a53f9d14
commit 3ed576b5c8
2 changed files with 12 additions and 2 deletions

View File

@ -122,6 +122,10 @@
top:0; top:0;
width:100%; width:100%;
height:100%; height:100%;
-ms-user-select:none;
-moz-user-select:none;
-webkit-user-select:none;
user-select:none;
} }
@media print { @media print {
.@CSS_PAGE_DECORATION_CN@ { .@CSS_PAGE_DECORATION_CN@ {

View File

@ -15,6 +15,7 @@ var pdf2htmlEX = (function(){
page_decoration : '@CSS_PAGE_DECORATION_CN@', page_decoration : '@CSS_PAGE_DECORATION_CN@',
page_content_box : '@CSS_PAGE_CONTENT_BOX_CN@', page_content_box : '@CSS_PAGE_CONTENT_BOX_CN@',
page_data : '@CSS_PAGE_DATA_CN@', page_data : '@CSS_PAGE_DATA_CN@',
background_image : '@CSS_BACKGROUND_IMAGE_CN@',
link : '@CSS_LINK_CN@', link : '@CSS_LINK_CN@',
__dummy__ : 'no comma' __dummy__ : 'no comma'
}; };
@ -126,11 +127,12 @@ var pdf2htmlEX = (function(){
this.outline = $('#'+this.outline_id); this.outline = $('#'+this.outline_id);
this.container = $('#'+this.container_id); this.container = $('#'+this.container_id);
// need a better design // Open the outline if nonempty
if(this.outline.children().length > 0) { if(this.outline.children().length > 0) {
this.outline.addClass('opened'); this.outline.addClass('opened');
} }
// collect pages
var new_pages = new Array(); var new_pages = new Array();
var pl= $('.'+CSS_CLASS_NAMES['page_frame'], this.container); var pl= $('.'+CSS_CLASS_NAMES['page_frame'], this.container);
/* don't use for(..in..) */ /* don't use for(..in..) */
@ -140,14 +142,18 @@ var pdf2htmlEX = (function(){
} }
this.pages = new_pages; this.pages = new_pages;
// register schedule rendering
var _ = this; var _ = this;
this.container.scroll(function(){ _.schedule_render(); }); this.container.scroll(function(){ _.schedule_render(); });
//this.zoom_fixer(); //this.zoom_fixer();
// used by outline/annot_link etc // handle links
this.container.add(this.outline).on('click', '.'+CSS_CLASS_NAMES['link'], this, this.link_handler); this.container.add(this.outline).on('click', '.'+CSS_CLASS_NAMES['link'], this, this.link_handler);
// disable background image draging
$('.'+CSS_CLASS_NAMES['background_image'], this.container).on('dragstart', function(e){return false;});
this.render(); this.render();
}, },
pre_hide_pages : function() { pre_hide_pages : function() {