Opened 16 years ago
Closed 16 years ago
#4977 closed defect (fixed)
Admin can't add pages to PDF book on IE8
Reported by: | Ryan J Ollos | Owned by: | Diorgenes Felipe Grzesiuk |
---|---|---|---|
Priority: | normal | Component: | TracWikiToPdfPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
The feature works fine on Firefox 3, however on IE8 pages can't be added to a PDF book. When a page is highlighted from the All Pages list and the down arrow is pressed, nothing happens. Here is the error that results:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618) Timestamp: Fri, 24 Apr 2009 07:14:34 UTC
Message: Invalid argument. Line: 7 Char: 12 Code: 0 URI: https://trac.physiosonics.com/chrome/wikitopdf/js/admin_wikitopdf.js
Attachments (0)
Change History (4)
comment:1 Changed 16 years ago by
comment:2 follow-up: 4 Changed 16 years ago by
It appears that MSIE does not support moving options between lists using the add method. We changed this function to create a new object instead. This seems to work in MSIE and FF.
function move_item(from, to) { var from_box = document.getElementById(from+'pages_select'); var to_box = document.getElementById(to+'pages_select'); for (var i = 0; i < from_box.options.length; i++) { var opt = from_box.options[i]; if (opt.selected) { var newOpt = new Option( opt.text, opt.value ); try { to_box.add(newOpt, null); // standards compliant } catch (ex) { to_box.add(newOpt); // MSIE } from_box.remove(i); i--; } } }
comment:4 Changed 16 years ago by
Keywords: | MESSAGE removed |
---|
Replying to mkc:
It appears that MSIE does not support moving options between lists using the add method. We changed this function to create a new object instead. This seems to work in MSIE and FF.
function move_item(from, to) { var from_box = document.getElementById(from+'pages_select'); var to_box = document.getElementById(to+'pages_select'); for (var i = 0; i < from_box.options.length; i++) { var opt = from_box.options[i]; if (opt.selected) { var newOpt = new Option( opt.text, opt.value ); try { to_box.add(newOpt, null); // standards compliant } catch (ex) { to_box.add(newOpt); // MSIE } from_box.remove(i); i--; } } }
This fixes the issue. Thanks.
comment:5 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied change to [5674].
Does this diff work?