Lines 163-168
define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ],
Link Here
|
163 |
var curLine = cm.getLine( cm.getCursor().line ); |
163 |
var curLine = cm.getLine( cm.getCursor().line ); |
164 |
|
164 |
|
165 |
$("#clipboard").prepend('<option>'+curLine+'</option>'); |
165 |
$("#clipboard").prepend('<option>'+curLine+'</option>'); |
|
|
166 |
$("#clipboard option:first-child").prop('selected', true); |
166 |
|
167 |
|
167 |
cm.execCommand('deleteLine'); |
168 |
cm.execCommand('deleteLine'); |
168 |
} |
169 |
} |
Lines 197-206
define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ],
Link Here
|
197 |
if ( !field ) return; |
198 |
if ( !field ) return; |
198 |
|
199 |
|
199 |
var curCursor = cm.getCursor(); |
200 |
var curCursor = cm.getCursor(); |
200 |
var subfield = field.getSubfieldAt( curCursor().ch ); |
201 |
var subfield = field.getSubfieldAt( curCursor.ch ); |
201 |
var subfieldText= cm.getRange({line:curCursor.line,ch:subfield.start},{line:curCursor.line,ch:subfield.end}); |
202 |
var subfieldText= cm.getRange({line:curCursor.line,ch:subfield.start},{line:curCursor.line,ch:subfield.end}); |
202 |
if ( subfield ) { |
203 |
if ( subfield ) { |
203 |
$("#clipboard").prepend('<option>'+subfieldText+'</option>'); |
204 |
$("#clipboard").prepend('<option>'+subfieldText+'</option>'); |
|
|
205 |
$("#clipboard option:first-child").prop('selected', true); |
204 |
subfield.delete(); |
206 |
subfield.delete(); |
205 |
} |
207 |
} |
206 |
} |
208 |
} |
Lines 210-215
define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ],
Link Here
|
210 |
if ( cm.somethingSelected() ) return true; |
212 |
if ( cm.somethingSelected() ) return true; |
211 |
var curLine = cm.getLine( cm.getCursor().line ); |
213 |
var curLine = cm.getLine( cm.getCursor().line ); |
212 |
$("#clipboard").prepend('<option>'+curLine+'</option>'); |
214 |
$("#clipboard").prepend('<option>'+curLine+'</option>'); |
|
|
215 |
$("#clipboard option:first-child").prop('selected', true); |
213 |
} |
216 |
} |
214 |
|
217 |
|
215 |
_editorKeys[copy_subfield] = function( cm ) { |
218 |
_editorKeys[copy_subfield] = function( cm ) { |
Lines 218-227
define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ],
Link Here
|
218 |
if ( !field ) return; |
221 |
if ( !field ) return; |
219 |
|
222 |
|
220 |
var curCursor = cm.getCursor(); |
223 |
var curCursor = cm.getCursor(); |
221 |
var subfield = field.getSubfieldAt( curCursor().ch ); |
224 |
var subfield = field.getSubfieldAt( curCursor.ch ); |
222 |
var subfieldText= cm.getRange({line:curCursor.line,ch:subfield.start},{line:curCursor.line,ch:subfield.end}); |
225 |
var subfieldText= cm.getRange({line:curCursor.line,ch:subfield.start},{line:curCursor.line,ch:subfield.end}); |
223 |
if ( subfield ) { |
226 |
if ( subfield ) { |
224 |
$("#clipboard").prepend('<option>'+subfieldText+'</option>'); |
227 |
$("#clipboard").prepend('<option>'+subfieldText+'</option>'); |
|
|
228 |
$("#clipboard option:first-child").prop('selected', true); |
225 |
} |
229 |
} |
226 |
} |
230 |
} |
227 |
|
231 |
|
228 |
- |
|
|