Fix usage of Return key in dialogs

pull/54/merge
Candid Dauth 2016-10-19 15:32:28 +03:00
rodzic 3fa03f90b2
commit 7c7440a1c4
17 zmienionych plików z 59 dodań i 47 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">About FacilMap</h3>
</div>
<div class="modal-body">

Wyświetl plik

@ -9,5 +9,5 @@
</dl>
</div>
</div>
<button class="btn btn-default visible-xs-block mobile-menu-button" ng-click="showXs = !showXs" uib-tooltip="{{showXs ? 'Hide legend' : 'Show legend'}}" tooltip-placement="left" tooltip-append-to-body="true"><span class="glyphicon glyphicon-info-sign"></span></button>
<button type="button" class="btn btn-default visible-xs-block mobile-menu-button" ng-click="showXs = !showXs" uib-tooltip="{{showXs ? 'Hide legend' : 'Show legend'}}" tooltip-placement="left" tooltip-append-to-body="true"><span class="glyphicon glyphicon-info-sign"></span></button>
</div>

Wyświetl plik

@ -1,9 +1,9 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Edit Line</h3>
</div>
<div class="modal-body">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="save()">
<div uib-alert class="alert-danger" ng-show="error">{{error}}</div>
<div class="form-group">
@ -36,6 +36,8 @@
<label for="line-{{$index}}-input" class="col-sm-3 control-label">{{field.name}}</label>
<div class="col-sm-9" fm-type-field="field" fm-type-field-model="line.data[field.name]" fm-type-field-id="line-{{$index}}-input"></div>
</div>
<button type="submit" class="hidden"></button>
</form>
</div>
<div class="modal-footer">
@ -47,5 +49,5 @@
</div>
<button type="button" class="btn btn-default" ng-click="$dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="save()">Save</button>
<button type="submit" class="btn btn-primary" ng-click="save()">Save</button>
</div>

Wyświetl plik

@ -9,7 +9,7 @@
</dl>
</div>
<div class="buttons" ng-if="!readonly">
<button class="btn btn-default" ng-click="edit()">Edit</button>
<button class="btn btn-default" ng-click="move()">Move</button>
<button class="btn btn-default" ng-click="delete()">Remove</button>
<button type="button" class="btn btn-default" ng-click="edit()">Edit</button>
<button type="button" class="btn btn-default" ng-click="move()">Move</button>
<button type="button" class="btn btn-default" ng-click="delete()">Remove</button>
</div>

Wyświetl plik

@ -1,9 +1,9 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Edit Marker</h3>
</div>
<div class="modal-body">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="save()">
<div uib-alert class="alert-danger" ng-show="error">{{error}}</div>
<div class="form-group">
@ -20,6 +20,8 @@
<label for="marker-{{$index}}-input" class="col-sm-3 control-label">{{field.name}}</label>
<div class="col-sm-9" fm-type-field="field" fm-type-field-model="marker.data[field.name]" fm-type-field-id="marker-{{$index}}-input"></div>
</div>
<button type="submit" class="hidden"></button>
</form>
</div>
<div class="modal-footer">

Wyświetl plik

@ -9,7 +9,7 @@
</dl>
</div>
<div class="buttons" ng-if="!readonly">
<button class="btn btn-default" ng-click="edit()">Edit</button>
<button class="btn btn-default" ng-click="move()">Move</button>
<button class="btn btn-default" ng-click="delete()">Remove</button>
<button type="button" class="btn btn-default" ng-click="edit()">Edit</button>
<button type="button" class="btn btn-default" ng-click="move()">Move</button>
<button type="button" class="btn btn-default" ng-click="delete()">Remove</button>
</div>

Wyświetl plik

@ -1,9 +1,9 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">{{create ? 'Start collaborative map' : 'Map settings'}}</h3>
</div>
<div class="modal-body">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="!writeError && !readError && save()">
<div uib-alert class="alert-danger" ng-show="error">{{error}}</div>
<div class="form-group" ng-class="{'has-error': !!writeError}">
@ -13,7 +13,7 @@
<span class="input-group-addon">{{urlPrefix}}</span>
<input id="pad-link-input" ng-model="writeId" class="form-control" />
<span class="input-group-btn" ng-if="!create">
<button class="btn btn-default" ng-click="copy(urlPrefix + writeId)">Copy</button>
<button type="button" class="btn btn-default" ng-click="copy(urlPrefix + writeId)">Copy</button>
</span>
</div>
<span class="help-block" ng-if="writeError">{{writeError}}</span>
@ -27,7 +27,7 @@
<span class="input-group-addon">{{urlPrefix}}</span>
<input id="pad-rolink-input" ng-model="readId" class="form-control" />
<span class="input-group-btn" ng-if="!create">
<button class="btn btn-default" ng-click="copy(urlPrefix + readId)">Copy</button>
<button type="button" class="btn btn-default" ng-click="copy(urlPrefix + readId)">Copy</button>
</span>
</div>
<span class="help-block" ng-if="readError">{{readError}}</span>
@ -38,9 +38,11 @@
<label for="pad-name-input" class="col-sm-3 control-label">Map name</label>
<div class="col-sm-9"><input id="pad-name-input" ng-model="padName" class="form-control" /></div>
</div>
<button type="submit" class="hidden"></button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="$dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="save()" ng-disabled="writeError || readError">{{create ? 'Create' : 'Save'}}</button>
<button type="submit" class="btn btn-primary" ng-click="save()" ng-disabled="writeError || readError">{{create ? 'Create' : 'Save'}}</button>
</div>

Wyświetl plik

@ -17,7 +17,7 @@
<li role="menuitem" ng-repeat="type in types | fmObjectFilter:{type:type}"><a href="javascript:" ng-click="addToMap(type)">{{type.name}}</a></li>
</ul>
</div>
<button ng-if="(types | fmPropertyCount:{type:type}) == 1" class="btn btn-default" ng-click="addToMap()">Add to map</button>
<button type="button" ng-if="(types | fmPropertyCount:{type:type}) == 1" class="btn btn-default" ng-click="addToMap()">Add to map</button>
<div uib-dropdown>
<button type="button" class="btn btn-default" uib-dropdown-toggle>Use as <span class="caret"></span></button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu">

Wyświetl plik

@ -4,7 +4,7 @@
<div class="form-group">
<div class="input-group">
<div class="has-feedback">
<input type="search" class="form-control" ng-model="searchString" placeholder="Search" tabindex="1">
<input type="search" class="form-control" ng-model="searchString" placeholder="Search" tabindex="1" autofocus>
<a href="javascript:" class="reset-button form-control-feedback" ng-click="searchString=''; search()" ng-show="searchString.length > 0"><span class="icon-clear"></span></a>
</div>
<span class="input-group-btn">
@ -25,7 +25,7 @@
</ul>
</div>
<div class="fm-search-buttons" ng-show="searchResults.length > 1">
<button class="btn btn-default" ng-model="showAll" uib-btn-checkbox>Show all</button>
<button type="button" class="btn btn-default" ng-model="showAll" uib-btn-checkbox>Show all</button>
</div>
</div>
</div>

Wyświetl plik

@ -1,5 +1,5 @@
<div class="fm-toolbox">
<button class="btn btn-default visible-xs-block mobile-menu-button" ng-click="showXs = !showXs" uib-tooltip="{{showXs ? 'Hide menu' : 'Show menu'}}" tooltip-placement="left"><span class="glyphicon glyphicon-menu-hamburger"></span></button>
<button type="button" class="btn btn-default visible-xs-block mobile-menu-button" ng-click="showXs = !showXs" uib-tooltip="{{showXs ? 'Hide menu' : 'Show menu'}}" tooltip-placement="left"><span class="glyphicon glyphicon-menu-hamburger"></span></button>
<nav class="navbar navbar-default" ng-class="{'hidden-xs': !showXs}">
<div class="container-fluid" id="fm-toolbox-content">
<ul class="nav navbar-nav">

Wyświetl plik

@ -1,9 +1,9 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Edit dropdown</h3>
</div>
<div class="modal-body">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="save()">
<div class="checkbox" ng-class="{disabled: !canControl('colour')}">
<label>
<input type="checkbox" ng-model="field.controlColour" ng-disabled="!canControl('colour')">
@ -31,20 +31,22 @@
<td><input type="text" ng-model="option.value" class="form-control"></td>
<td ng-if="field.controlColour"><input type="text" ng-model="option.colour" fm-colour-picker class="form-control"></td>
<td ng-if="field.controlWidth"><input type="text" ng-model="option.width" fm-spinner class="form-control"></td>
<td class="td-buttons"><button ng-click="deleteOption(option)" class="btn btn-default"><span class="glyphicon glyphicon-minus"></span></button></td>
<td class="td-buttons"><button type="button" ng-click="deleteOption(option)" class="btn btn-default"><span class="glyphicon glyphicon-minus"></span></button></td>
<td class="td-buttons move"><a href="javascript:" class="btn btn-default sort-handle"><span class="glyphicon glyphicon-resize-vertical"></span></a></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4"><button ng-click="addOption()" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span></button></td>
<td colspan="4"><button type="button" ng-click="addOption()" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span></button></td>
<td class="move"></td>
</tr>
</tfoot>
</table>
<button type="submit" class="hidden"></button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="$dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="save()">OK</button>
<button type="submit" class="btn btn-primary" ng-click="save()">OK</button>
</div>

Wyświetl plik

@ -1,9 +1,9 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Edit object type</h3>
</div>
<div class="modal-body">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="save()">
<div uib-alert class="alert-danger" ng-show="error">{{error}}</div>
<div class="form-group">
@ -41,7 +41,7 @@
<option value="dropdown">Dropdown</option>
<option value="checkbox">Checkbox</option>
</select>
<span class="input-group-btn"><button ng-click="editDropdown(field)" class="btn btn-default">Edit</button></span>
<span class="input-group-btn"><button type="button" ng-click="editDropdown(field)" class="btn btn-default">Edit</button></span>
</div>
<select ng-if="field.type != 'dropdown'" ng-model="field.type" class="form-control">
<option value="input">Text field</option>
@ -51,20 +51,22 @@
</select>
</td>
<td fm-type-field="field" fm-type-field-model="field.default" fm-type-field-ignore-default></td>
<td class="td-buttons"><button ng-click="deleteField(field)" class="btn btn-default">Delete</button></td>
<td class="td-buttons"><button type="button" ng-click="deleteField(field)" class="btn btn-default">Delete</button></td>
<td class="move td-buttons"><a href="javascript:" class="btn btn-default sort-handle"><span class="glyphicon glyphicon-resize-vertical"></span></a></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4"><button ng-click="createField()" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span></button></td>
<td colspan="4"><button type="button" ng-click="createField()" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span></button></td>
<td class="move"></td>
</tr>
</tfoot>
</table>
<button type="submit" class="hidden"></button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="$dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="save()">Save</button>
<button type="submit" class="btn btn-primary" ng-click="save()">Save</button>
</div>

Wyświetl plik

@ -1,5 +1,5 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Object types</h3>
</div>
<div class="modal-body">
@ -17,14 +17,14 @@
<td>{{type.name}}</td>
<td>{{type.type}}</td>
<td class="td-buttons">
<button ng-click="edit(type)" class="btn btn-default">Edit</button>
<button ng-click="delete(type)" class="btn btn-default">Delete</button>
<button type="button" ng-click="edit(type)" class="btn btn-default">Edit</button>
<button type="button" ng-click="delete(type)" class="btn btn-default">Delete</button>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3"><button ng-click="create()" class="btn btn-default">Create</button></td>
<td colspan="3"><button type="button" ng-click="create()" class="btn btn-default">Create</button></td>
</tr>
</tfoot>
</table>

Wyświetl plik

@ -1,5 +1,5 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Manage Views</h3>
</div>
<div class="modal-body">
@ -9,8 +9,8 @@
<tr ng-class="{success: view.id == padData.defaultView.id}" ng-repeat="view in views">
<td><a href="javascript:" ng-click="display(view)">{{view.name}}</a></td>
<td class="td-buttons">
<button ng-hide="view.id == padData.defaultView.id" ng-click="makeDefault(view)" class="btn btn-default">Make default</button>
<button ng-click="delete(view)" class="btn btn-default">Delete</button>
<button type="button" ng-hide="view.id == padData.defaultView.id" ng-click="makeDefault(view)" class="btn btn-default">Make default</button>
<button type="button" ng-click="delete(view)" class="btn btn-default">Delete</button>
</td>
</tr>
</tbody>

Wyświetl plik

@ -1,18 +1,20 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Save current view</h3>
</div>
<div class="modal-body">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="save(false)">
<div uib-alert class="alert-danger" ng-if="error">{{error}}</div>
<div. class="form-group">
<div class="form-group">
<label for="save-view-name" class="col-sm-3 control-label">Name</label>
<div class="col-sm-9"><input id="save-view-name" ng-model="name" class="form-control"></div>
</div.>
</div>
<button type="submit" class="hidden"></button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="$dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="save(false)">Save</button>
<button type="submit" class="btn btn-primary" ng-click="save(false)">Save</button>
<button type="button" class="btn btn-success" ng-click="save(true)">Save and make default view</button>
</div>

Wyświetl plik

@ -1,5 +1,5 @@
<div class="modal-header">
<button class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" ng-click="$dismiss()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Table</h3>
</div>
<div class="modal-body">

Wyświetl plik

@ -199,7 +199,7 @@
};
fmUtils.copyToClipboard = function(text) {
var el = $("<button></button>").css("display", "none").appendTo("body");
var el = $('<button type="button"></button>').css("display", "none").appendTo("body");
var c = new Clipboard(el[0], {
text: function() {
return text;