Skip to content

Commit

Permalink
Merge pull request #617 from IIHS/feature-visual-editor-search-replace
Browse files Browse the repository at this point in the history
Fixing replace all enable state and cleaning up layout of source find…
  • Loading branch information
Marcus Wendt committed Sep 3, 2018
2 parents 4ecfc2f + 17e3e24 commit c32918e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 38 deletions.
Expand Up @@ -55,8 +55,6 @@ SourceEditorFindAndReplaceToolBarButtonBinding.prototype.onBindingAttach = funct
*/
SourceEditorFindAndReplaceToolBarButtonBinding.prototype.initializeSourceEditorComponent = function(binding, editor) {

debugger;

this._editorBinding = binding;
this._codemirrorEditor = editor;

Expand Down
Expand Up @@ -37,42 +37,44 @@
<ui:broadcaster id="broadcasterReplace" isdisabled="false"/>
<ui:broadcaster id="broadcasterReplaceAll" isdisabled="false"/>
</ui:broadcasterset>
<ui:dialogpage label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelTitle}" image="${icon:composite}" height="auto" resizable="false" style="padding: 10px;" binding="CodemirrorFindAndReplace">
<ui:flexbox>
<ui:fields>
<ui:fieldgroup>
<ui:field>
<ui:fielddesc class="left-label" label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelFind}"/>
<ui:fielddata>
<ui:datainput id="searchFor" default="true">
</ui:datainput>
</ui:fielddata>
</ui:field>
<ui:field>
<ui:fielddesc class="left-label" label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelReplaceWith}"/>
<ui:fielddata>
<ui:datainput id="replaceWith"></ui:datainput>
</ui:fielddata>
</ui:field>
</ui:fieldgroup>
</ui:fields>
<div>
<div class="checkBoxSettings">
<ui:field>
<ui:fielddata>
<ui:checkbox label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelWholeWords}" id="matchWholeWord"></ui:checkbox>
</ui:fielddata>
</ui:field>
</div>
<div class="checkBoxSettings">
<ui:field>
<ui:fielddata>
<ui:checkbox label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelMatchCase}" id="matchCase"></ui:checkbox>
</ui:fielddata>
</ui:field>
</div>
</div>
</ui:flexbox>
<ui:dialogpage label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelTitle}" image="${icon:composite}" height="auto" resizable="false" binding="CodemirrorFindAndReplace">
<ui:pagebody>
<ui:flexbox>
<ui:fields>
<ui:fieldgroup>
<ui:field>
<ui:fielddesc class="left-label" label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelFind}"/>
<ui:fielddata>
<ui:datainput id="searchFor" default="true">
</ui:datainput>
</ui:fielddata>
</ui:field>
<ui:field>
<ui:fielddesc class="left-label" label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelReplaceWith}"/>
<ui:fielddata>
<ui:datainput id="replaceWith"></ui:datainput>
</ui:fielddata>
</ui:field>
</ui:fieldgroup>
</ui:fields>
<div>
<div class="checkBoxSettings">
<ui:field>
<ui:fielddata>
<ui:checkbox label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelWholeWords}" id="matchWholeWord"></ui:checkbox>
</ui:fielddata>
</ui:field>
</div>
<div class="checkBoxSettings">
<ui:field>
<ui:fielddata>
<ui:checkbox label="${string:Composite.Web.SourceEditor:FindAndReplace.LabelMatchCase}" id="matchCase"></ui:checkbox>
</ui:fielddata>
</ui:field>
</div>
</div>
</ui:flexbox>
</ui:pagebody>
<ui:dialogtoolbar>
<ui:toolbarbody align="right" equalsize="true">
<ui:toolbargroup>
Expand Down
Expand Up @@ -66,6 +66,7 @@ CodemirrorFindAndReplace.prototype.setPageArgument = function (arg) {

this._initialized = true;
map.broadcasterReplace.setDisabled(true);
map.broadcasterReplaceAll.setDisabled(true);
}

CodemirrorFindAndReplace.prototype.getChecked = function (control) {
Expand Down Expand Up @@ -144,12 +145,14 @@ CodemirrorFindAndReplace.prototype.findNextText = function () {

this._editor.setSelection(this._cursor.from(), this._cursor.to());
map.broadcasterReplace.setDisabled(false);
map.broadcasterReplaceAll.setDisabled(false);
this._textPosition = this._cursor.to()

}
else {
this._textPosition = false;
map.broadcasterReplace.setDisabled(true);
map.broadcasterReplaceAll.setDisabled(true);
}

}
Expand Down

0 comments on commit c32918e

Please sign in to comment.