<div class="tight-form">
	<ul class="tight-form-list pull-right">
		<li ng-show="parserError" class="tight-form-item">
			<a bs-tooltip="parserError" style="color: rgb(229, 189, 28)" role="menuitem">
				<i class="fa fa-warning"></i>
			</a>
		</li>
		<li class="tight-form-item small" ng-show="target.datasource">
			<em>{{target.datasource}}</em>
		</li>
		<li class="tight-form-item">
			<div class="dropdown">
				<a class="pointer dropdown-toggle" data-toggle="dropdown" tabindex="1">
					<i class="fa fa-bars"></i>
				</a>
				<ul class="dropdown-menu pull-right" role="menu">
					<li role="menuitem">
						<a tabindex="1" ng-click="toggleEditorMode()">
							Switch editor mode
						</a>
					</li>
					<li role="menuitem">
						<a tabindex="1" ng-click="duplicateDataQuery(target)">Duplicate</a>
					</li>
					<li role="menuitem">
						<a tabindex="1" ng-click="moveDataQuery($index, $index-1)">Move up</a>
					</li>
					<li role="menuitem">
						<a tabindex="1" ng-click="moveDataQuery($index, $index+1)">Move down</a>
					</li>
				</ul>
			</div>
		</li>
		<li class="tight-form-item last">
			<a class="pointer" tabindex="1" ng-click="removeDataQuery(target)">
				<i class="fa fa-remove"></i>
			</a>
		</li>
	</ul>

	<ul class="tight-form-list">
		<li class="tight-form-item" style="min-width: 15px; text-align: center">
			{{target.refId}}
		</li>
		<li>
			<a class="tight-form-item" ng-click="target.hide = !target.hide; get_data();" role="menuitem">
				<i class="fa fa-eye"></i>
			</a>
		</li>
	</ul>

	<input type="text" class="tight-form-clear-input span10" ng-model="target.target" give-focus="target.textEditor" spellcheck='false' ng-model-onblur ng-change="get_data()" ng-show="target.textEditor"></input>

	<ul class="tight-form-list" role="menu" ng-hide="target.textEditor">
		<li ng-repeat="segment in segments" role="menuitem">
			<metric-segment segment="segment" get-options="getAltSegments($index)" on-change="segmentValueChanged(segment, $index)"></metric-segment>
		</li>
		<li ng-repeat="func in functions">
			<span graphite-func-editor class="tight-form-item tight-form-func">
			</span>
		</li>
		<li class="dropdown" graphite-add-func>
		</li>
	</ul>
	<div class="clearfix"></div>
</div>
