Bugzilla – Attachment 43623 Details for
Bug 11559
Professional cataloger's interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11559: (followup) fix first-character deletion, small usability issues
Bug-11559-followup-fix-first-character-deletion-sm.patch (text/plain), 4.42 KB, created by
Jesse Weaver
on 2015-10-19 23:50:14 UTC
(
hide
)
Description:
Bug 11559: (followup) fix first-character deletion, small usability issues
Filename:
MIME Type:
Creator:
Jesse Weaver
Created:
2015-10-19 23:50:14 UTC
Size:
4.42 KB
patch
obsolete
>From 3e5e51935809d145b168b137792b6d32f0632b1a Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <pianohacker@gmail.com> >Date: Mon, 19 Oct 2015 17:47:13 -0600 >Subject: [PATCH] Bug 11559: (followup) fix first-character deletion, small > usability issues > >This should fix the first-character deletion bug reported by Nick, and also: > > * Fix subfield deletion > * Attempted fix for special keys on dropdowns > * Allow deleting empty fields > * Fix bug with composed characters >--- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js | 6 ++++-- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js | 2 +- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js | 12 +++++++++--- > 3 files changed, 14 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js >index 3ccb284..91a286d 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js >@@ -152,8 +152,7 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], > // Delete line (or cut) > if ( cm.somethingSelected() ) return true; > >- var field = cm.marceditor.getCurrentField(); >- if ( field ) field.delete(); >+ cm.execCommand('deleteLine'); > }, > > 'Shift-Ctrl-X': function( cm ) { >@@ -272,6 +271,9 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], > return this.field._subfieldsInvalid(); > }, > >+ delete: function() { >+ this.cm.replaceRange( "", { line: this.field.line, ch: this.start }, { line: this.field.line, ch: this.end }, 'marcAware' ); >+ }, > focus: function() { > this.cm.setCursor( { line: this.field.line, ch: this.contentsStart } ); > }, >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js >index b8226ec..0440a99 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js >@@ -88,7 +88,7 @@ define( [ 'marc-record' ], function( MARC ) { > $.each( subfields, function( i, subfield ) { > var next = subfields[ i + 1 ]; > >- field.addSubfield( [ subfield.code, line.substring( subfield.ch + 3, next ? next.ch : line.length ) ] ); >+ field.addSubfield( [ subfield.code, line.substring( subfield.ch + 2, next ? next.ch : line.length ) ] ); > } ); > > field.sourceLine = i; >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js >index ec03ecf..7ea3fc8 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js >@@ -169,7 +169,13 @@ define( [ 'resources' ], function( Resources ) { > > $inputs.each( function( i ) { > $(this).on( 'keydown.marc-tab', function( e ) { >- if ( e.which != 9 ) return; // Tab >+ // Cheap hack to disable backspace and special keys >+ if ( ( this.nodeName.toLowerCase() == 'select' && e.which == 9 ) || e.ctrlKey ) { >+ e.preventDefault(); >+ return; >+ } else if ( e.which != 9 ) { // Tab >+ return; >+ } > > var span = widget.mark.find(); > var cur = editor.cm.getCursor(); >@@ -210,7 +216,7 @@ define( [ 'resources' ], function( Resources ) { > > ActivateAt: function( editor, cur, idx ) { > var marks = editor.findMarksAt( cur ); >- if ( !marks.length ) return false; >+ if ( !marks.length || !marks[0].widget ) return false; > > var $input = $(marks[0].widget.node).find('input, select').eq(idx || 0); > if ( !$input.length ) return false; >@@ -264,7 +270,7 @@ define( [ 'resources' ], function( Resources ) { > if ( marks.length ) { > if ( marks[0].id == id ) { > return; >- } else { >+ } else if ( marks[0].widget ) { > marks[0].widget.clearToText(); > } > } >-- >2.6.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11559
:
26069
|
26070
|
26071
|
26104
|
26653
|
26654
|
27140
|
27141
|
27142
|
27757
|
27758
|
27759
|
27760
|
27761
|
27900
|
27901
|
27902
|
27993
|
27995
|
34458
|
34459
|
34460
|
34461
|
34462
|
34463
|
36243
|
36244
|
36245
|
36246
|
36247
|
36248
|
36455
|
38533
|
38534
|
38535
|
38536
|
38537
|
38538
|
38539
|
40153
|
40154
|
40155
|
40543
|
40555
|
40556
|
40557
|
40558
|
40811
|
40812
|
40813
|
40814
|
40815
|
41425
|
41453
|
41476
|
42373
|
43261
|
43547
|
43614
|
43615
|
43616
|
43617
|
43618
|
43619
|
43620
|
43621
|
43622
|
43623
|
43703
|
43704
|
43705
|
43706
|
43707
|
43708
|
43709
|
43710
|
43711
|
43712
|
43713
|
43772
|
43790
|
43883
|
43969
|
44016
|
44018
|
44022
|
44023
|
44024
|
44025
|
44026
|
44027
|
44028
|
44029
|
44030
|
44031
|
44032
|
44033
|
44034
|
44035
|
44036