|
24 | 24 | */
|
25 | 25 |
|
26 | 26 | (function (HUB,HTML,AJAX,CALLBACK,OUTPUT) {
|
27 |
| - var VERSION = "2.0.5"; |
| 27 | + var VERSION = "2.0.6"; |
28 | 28 |
|
29 | 29 | var SIGNAL = MathJax.Callback.Signal("menu") // signal for menu events
|
30 | 30 |
|
|
50 | 50 | windowSettings: { // for source window
|
51 | 51 | status: "no", toolbar: "no", locationbar: "no", menubar: "no",
|
52 | 52 | directories: "no", personalbar: "no", resizable: "yes", scrollbars: "yes",
|
53 |
| - width: 100, height: 50 |
| 53 | + width: 400, height: 300, |
| 54 | + left: Math.round((screen.width - 400)/2), |
| 55 | + top: Math.round((screen.height - 300)/3) |
54 | 56 | },
|
55 | 57 |
|
56 | 58 | styles: {
|
|
700 | 702 | return MENU.ShowSource.w;
|
701 | 703 | };
|
702 | 704 | MENU.ShowSource.Text = function (text,event) {
|
703 |
| - var w = MENU.ShowSource.Window(event); |
| 705 | + var w = MENU.ShowSource.Window(event); delete MENU.ShowSource.w; |
704 | 706 | text = text.replace(/^\s*/,"").replace(/\s*$/,"");
|
705 | 707 | text = text.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
706 | 708 | if (MENU.isMobile) {
|
|
717 | 719 | w.document.write("</body></html>");
|
718 | 720 | w.document.close();
|
719 | 721 | var table = w.document.body.firstChild;
|
720 |
| - var H = (w.outerHeight-w.innerHeight)||30, W = (w.outerWidth-w.innerWidth)||30; |
721 |
| - W = Math.min(Math.floor(.5*screen.width),table.offsetWidth+W+25); |
722 |
| - H = Math.min(Math.floor(.5*screen.height),table.offsetHeight+H+25); |
723 |
| - w.resizeTo(W,H); |
724 |
| - if (event && event.screenX != null) { |
725 |
| - var x = Math.max(0,Math.min(event.screenX-Math.floor(W/2), screen.width-W-20)), |
726 |
| - y = Math.max(0,Math.min(event.screenY-Math.floor(H/2), screen.height-H-20)); |
727 |
| - w.moveTo(x,y); |
728 |
| - } |
| 722 | + setTimeout(function () { |
| 723 | + var H = (w.outerHeight-w.innerHeight)||30, W = (w.outerWidth-w.innerWidth)||30, x, y; |
| 724 | + W = Math.max(100,Math.min(Math.floor(.5*screen.width),table.offsetWidth+W+25)); |
| 725 | + H = Math.max(40,Math.min(Math.floor(.5*screen.height),table.offsetHeight+H+25)); |
| 726 | + w.resizeTo(W,H); |
| 727 | + if (event && event.screenX != null) { |
| 728 | + x = Math.max(0,Math.min(event.screenX-Math.floor(W/2), screen.width-W-20)); |
| 729 | + y = Math.max(0,Math.min(event.screenY-Math.floor(H/2), screen.height-H-20)); |
| 730 | + w.moveTo(x,y); |
| 731 | + } |
| 732 | + },50); |
729 | 733 | }
|
730 |
| - delete MENU.ShowSource.w; |
731 | 734 | };
|
732 | 735 |
|
733 | 736 | /*
|
|
0 commit comments