File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -468,14 +468,18 @@ $(document).ready(function () {
468
468
$ ( '[data-toggle="tooltip"]' ) . tooltip ( )
469
469
// shortcuts
470
470
// allow on all tags
471
+
471
472
key . filter = function ( e ) { return true }
472
473
key ( 'ctrl+alt+e' , function ( e ) {
474
+ if ( ui . toolbar . edit . data ( 'blockSource' ) ) return
473
475
changeMode ( modeType . edit )
474
476
} )
477
+ // add here exeption when "exeption = true" run code below, false = return
475
478
key ( 'ctrl+alt+v' , function ( e ) {
476
479
changeMode ( modeType . view )
477
480
} )
478
481
key ( 'ctrl+alt+b' , function ( e ) {
482
+ if ( ui . toolbar . edit . data ( 'blockSource' ) ) return
479
483
changeMode ( modeType . both )
480
484
} )
481
485
// toggle-dropdown
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export const getUIElements = () => ({
36
36
edit : $ ( '.ui-edit' ) ,
37
37
view : $ ( '.ui-view' ) ,
38
38
both : $ ( '.ui-both' ) ,
39
+ blockVisibleSourse : $ ( '.ui-block-visible-source' ) ,
39
40
night : $ ( '.ui-night' ) ,
40
41
uploadImage : $ ( '.ui-upload-image' )
41
42
} ,
Original file line number Diff line number Diff line change 84
84
<div class =" collapse navbar-collapse" >
85
85
<ul class =" nav navbar-nav navbar-form navbar-left" style =" padding :0 ;" >
86
86
<div class =" btn-group" data-toggle =" buttons" >
87
- <% if (allowVisibleSource) { % >
87
+ <% if ((permission === " limited" || " editable" || " freely" ) && ! allowVisibleSource) { % >
88
+ < div id= " blockVisibleSourse" class = " ui-block-visible-source" block- visible- sourse= " true" >< / div>
89
+ < label class = " btn btn-default ui-edit" data- block- source= " true" title= " <%= __('You have no rights to edit this note')%>" disabled>
90
+ < input type= " radio" autocomplete= " off" >< i class = " fa fa-pencil" >< / i>
91
+ < / label>
92
+ < label class = " btn btn-default ui-both" data- block- source= " true" title= " <%= __('You have no rights to edit this note')%>" disabled>
93
+ < input type= " radio" autocomplete= " off" >< i class = " fa fa-columns" >< / i>
94
+ < / label>
95
+ < % } else { % >
88
96
< label class = " btn btn-default ui-edit" title= " <%= __('Edit') %> (Ctrl+Alt+E)" >
89
97
< input type= " radio" name= " mode" autocomplete= " off" >< i class = " fa fa-pencil" >< / i>
90
98
< / label>
91
99
< label class = " btn btn-default ui-both" title= " <%= __('Both') %> (Ctrl+Alt+B)" >
92
100
< input type= " radio" name= " mode" autocomplete= " off" >< i class = " fa fa-columns" >< / i>
93
101
< / label>
94
- < % } else { % >
95
- < label class = " btn btn-default" title= " <%= __('You have no rights to edit this note')%>" disabled>
96
- < input type= " radio" autocomplete= " off" >< i class = " fa fa-pencil" >< / i>
97
- < / label>
98
- < label class = " btn btn-default" title= " <%= __('You have no rights to edit this note')%>" disabled>
99
- < input type= " radio" autocomplete= " off" >< i class = " fa fa-columns" >< / i>
100
- < / label>
101
102
< % } %>
102
103
<label class =" btn btn-default ui-view" title =" <%= __('View') %> (Ctrl+Alt+V)" >
103
104
<input type =" radio" name =" mode" autocomplete =" off" ><i class =" fa fa-eye" ></i >
You can’t perform that action at this time.
0 commit comments