Lines 169-175
define( [ 'resources' ], function( Resources ) {
Link Here
|
169 |
|
169 |
|
170 |
$inputs.each( function( i ) { |
170 |
$inputs.each( function( i ) { |
171 |
$(this).on( 'keydown.marc-tab', function( e ) { |
171 |
$(this).on( 'keydown.marc-tab', function( e ) { |
172 |
if ( e.which != 9 ) return; // Tab |
172 |
// Cheap hack to disable backspace and special keys |
|
|
173 |
if ( ( this.nodeName.toLowerCase() == 'select' && e.which == 9 ) || e.ctrlKey ) { |
174 |
e.preventDefault(); |
175 |
return; |
176 |
} else if ( e.which != 9 ) { // Tab |
177 |
return; |
178 |
} |
173 |
|
179 |
|
174 |
var span = widget.mark.find(); |
180 |
var span = widget.mark.find(); |
175 |
var cur = editor.cm.getCursor(); |
181 |
var cur = editor.cm.getCursor(); |
Lines 210-216
define( [ 'resources' ], function( Resources ) {
Link Here
|
210 |
|
216 |
|
211 |
ActivateAt: function( editor, cur, idx ) { |
217 |
ActivateAt: function( editor, cur, idx ) { |
212 |
var marks = editor.findMarksAt( cur ); |
218 |
var marks = editor.findMarksAt( cur ); |
213 |
if ( !marks.length ) return false; |
219 |
if ( !marks.length || !marks[0].widget ) return false; |
214 |
|
220 |
|
215 |
var $input = $(marks[0].widget.node).find('input, select').eq(idx || 0); |
221 |
var $input = $(marks[0].widget.node).find('input, select').eq(idx || 0); |
216 |
if ( !$input.length ) return false; |
222 |
if ( !$input.length ) return false; |
Lines 264-270
define( [ 'resources' ], function( Resources ) {
Link Here
|
264 |
if ( marks.length ) { |
270 |
if ( marks.length ) { |
265 |
if ( marks[0].id == id ) { |
271 |
if ( marks[0].id == id ) { |
266 |
return; |
272 |
return; |
267 |
} else { |
273 |
} else if ( marks[0].widget ) { |
268 |
marks[0].widget.clearToText(); |
274 |
marks[0].widget.clearToText(); |
269 |
} |
275 |
} |
270 |
} |
276 |
} |
271 |
- |
|
|