Index: trunk/extensions/VisualEditor/modules/es/es.Surface.css |
— | — | @@ -42,32 +42,45 @@ |
43 | 43 | |
44 | 44 | .es-contextView-icon { |
45 | 45 | position: absolute; |
46 | | - background-position: top left; |
47 | 46 | background-repeat: no-repeat; |
48 | | - width: 31px; |
49 | | - height: 31px; |
| 47 | + width: 15px; |
| 48 | + height: 15px; |
50 | 49 | display: none; |
51 | 50 | cursor: pointer; |
| 51 | + border: solid 1px #cccccc; |
| 52 | + -webkit-border-radius: 1em; |
| 53 | + -moz-border-radius: 1em; |
| 54 | + -o-border-radius: 1em; |
| 55 | + border-radius: 1em; |
| 56 | + background-color: white; |
| 57 | + -webkit-box-shadow: 0 0.25em 1em 0 rgba(0,0,0,0.25); |
| 58 | + -moz-box-shadow: 0 0.25em 1em 0 rgba(0,0,0,0.25); |
| 59 | + box-shadow: 0 0.25em 1em 0 rgba(0,0,0,0.25); |
52 | 60 | } |
53 | 61 | |
| 62 | +.es-contextView-position-start .es-contextView-icon { |
| 63 | + top: -12px; |
| 64 | + left: -8px; |
| 65 | +} |
| 66 | + |
| 67 | +.es-contextView-position-end .es-contextView-icon { |
| 68 | + top: -6px; |
| 69 | + left: -8px; |
| 70 | +} |
| 71 | + |
54 | 72 | .es-contextView-position-above .es-contextView-icon { |
55 | | - background-image: url(images/context-icon-up.png); |
56 | | - top: -24px; |
57 | | - left: -15px; |
| 73 | + background-image: url(images/arrow-up.png); |
| 74 | + background-position: 4px 4px; |
58 | 75 | } |
59 | 76 | |
60 | 77 | .es-contextView-position-below .es-contextView-icon { |
61 | | - background-image: url(images/context-icon-down.png); |
62 | | - top: -7px; |
63 | | - left: -16px; |
| 78 | + background-image: url(images/arrow-down.png); |
| 79 | + background-position: 4px 5px; |
64 | 80 | } |
65 | 81 | |
66 | | -.es-contextView-position-above .es-contextView-icon:hover { |
67 | | - background-image: url(images/context-icon-up-hover.png); |
68 | | -} |
69 | | - |
| 82 | +.es-contextView-position-above .es-contextView-icon:hover, |
70 | 83 | .es-contextView-position-below .es-contextView-icon:hover { |
71 | | - background-image: url(images/context-icon-down-hover.png); |
| 84 | + border-color: #b3d6f6; |
72 | 85 | } |
73 | 86 | |
74 | 87 | .es-contextView-menu { |
— | — | @@ -118,10 +131,10 @@ |
119 | 132 | height: 1em; |
120 | 133 | padding: 0.25em; |
121 | 134 | border: solid 1px white; |
122 | | - -webkit-border-radius: 0.25em; |
123 | | - -moz-border-radius: 0.25em; |
124 | | - -o-border-radius: 0.25em; |
125 | | - border-radius: 0.25em; |
| 135 | + -webkit-border-radius: 0.125em; |
| 136 | + -moz-border-radius: 0.125em; |
| 137 | + -o-border-radius: 0.125em; |
| 138 | + border-radius: 0.125em; |
126 | 139 | background-position: center center; |
127 | 140 | background-position: no-repeat; |
128 | 141 | cursor: pointer; |
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon-up.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon-down-hover.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon.psd |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon-up-hover.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon-down.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/VisualEditor/modules/es/images/arrow.psd |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/VisualEditor/modules/es/images/arrow.psd |
___________________________________________________________________ |
Added: svn:mime-type |
129 | 142 | + application/octet-stream |
Index: trunk/extensions/VisualEditor/modules/es/images/arrow-down.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/VisualEditor/modules/es/images/arrow-down.png |
___________________________________________________________________ |
Added: svn:mime-type |
130 | 143 | + application/octet-stream |
Index: trunk/extensions/VisualEditor/modules/es/images/arrow-up.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/VisualEditor/modules/es/images/arrow-up.png |
___________________________________________________________________ |
Added: svn:mime-type |
131 | 144 | + application/octet-stream |
Index: trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js |
— | — | @@ -37,12 +37,12 @@ |
38 | 38 | es.ContextView.prototype.set = function() { |
39 | 39 | this.$.removeClass( |
40 | 40 | 'es-contextView-position-below es-contextView-position-above ' + |
41 | | - 'es-contextView-position-left es-contextView-position-right' |
| 41 | + 'es-contextView-position-left es-contextView-position-right' + |
| 42 | + 'es-contextView-position-start es-contextView-position-end' |
42 | 43 | ); |
43 | 44 | var selection = this.surfaceView.getModel().getSelection(), |
44 | 45 | position, |
45 | | - offset, |
46 | | - bias; |
| 46 | + offset; |
47 | 47 | if ( selection.from < selection.to ) { |
48 | 48 | var $lastRange = this.surfaceView.$.find( '.es-contentView-range:visible:last' ); |
49 | 49 | if ( $lastRange.length ) { |
— | — | @@ -50,14 +50,14 @@ |
51 | 51 | position = new es.Position( |
52 | 52 | offset.left + $lastRange.width(), offset.top + $lastRange.height() |
53 | 53 | ); |
54 | | - this.$.addClass( 'es-contextView-position-below' ); |
| 54 | + this.$.addClass( 'es-contextView-position-end' ); |
55 | 55 | } |
56 | 56 | } else if ( selection.from > selection.to ) { |
57 | 57 | var $firstRange = this.surfaceView.$.find( '.es-contentView-range:visible:first' ); |
58 | 58 | if ( $firstRange.length ) { |
59 | 59 | offset = $firstRange.offset(); |
60 | 60 | position = new es.Position( offset.left, offset.top ); |
61 | | - this.$.addClass( 'es-contextView-position-above' ); |
| 61 | + this.$.addClass( 'es-contextView-position-start' ); |
62 | 62 | } |
63 | 63 | } |
64 | 64 | if ( position ) { |
— | — | @@ -66,6 +66,11 @@ |
67 | 67 | } else { |
68 | 68 | this.$.addClass( 'es-contextView-position-right' ); |
69 | 69 | } |
| 70 | + if ( position.top + this.$menu.height() < $( window ).height() ) { |
| 71 | + this.$.addClass( 'es-contextView-position-below' ); |
| 72 | + } else { |
| 73 | + this.$.addClass( 'es-contextView-position-above' ); |
| 74 | + } |
70 | 75 | this.$.css( { 'left': position.left, 'top': position.top } ); |
71 | 76 | this.$icon.fadeIn( 'fast' ); |
72 | 77 | } |
Index: trunk/extensions/VisualEditor/modules/es/views/es.ContentView.js |
— | — | @@ -253,6 +253,8 @@ |
254 | 254 | 'width': toPosition.left, |
255 | 255 | 'height': toPosition.bottom - toPosition.top |
256 | 256 | } ).show(); |
| 257 | + } else { |
| 258 | + this.$rangeEnd.hide(); |
257 | 259 | } |
258 | 260 | if ( fromLineIndex + 1 < toLineIndex ) { |
259 | 261 | this.$rangeFill.css( { |