<div class="modal" tabindex="-1" role="dialog">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" ng-click="$hide()">&times;</button>
				<h4 class="modal-title">{{title}}</h4>
			</div>

			<form name="editButtonForm" role="form" ng-submit="edit(selectedBtn, newBtn)" novalidate>
				<div class="modal-body" >
					<label>Select a button</label>
					<div class="form-group">

						<p style="margin-bottom:0">Device</p>
						<ui-select  ng-model="alias.device" theme="bootstrap" on-select="selectDevice($item)" required>
							<ui-select-match placeholder="Select or search a device the list...">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="device in devices | filter: $select.search">
								<span ng-bind-html="device.name | highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<br/>
						<p style="margin-bottom:0">Function</p>
						<ui-select ng-model="alias.func" theme="bootstrap" on-select="selectFunction($item)" required>
							<ui-select-match placeholder="Select or search a function in the list...">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="func in alias.device.funcs | filter: $select.search">
								<span ng-bind-html="func.name | highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>

					</div>

					<div class="form-group" style="height:150px;">
					</div>

				</div>
				<div class="modal-footer">
					<button type="submit" class="btn btn-primary" ng-disabled="editButtonForm.$invalid">Done</button>
					<button type="button" class="btn btn-danger" ng-click="$hide()">Cancel</button>
				</div>

			</form>
		</div>
	</div>
</div>
