Merge pull request #5161 from opf/accessibility/jquery-ui-autocomplete
Replace bootstrap typeahead with jquery-uipull/5164/head
commit
43b79be8f2
@ -1,27 +0,0 @@ |
|||||||
|
|
||||||
[uib-typeahead-popup].dropdown-menu |
|
||||||
position: absolute |
|
||||||
margin: 0 |
|
||||||
z-index: 100 |
|
||||||
list-style: none |
|
||||||
background: white |
|
||||||
border: 1px solid rgba(0,0,0,.15) |
|
||||||
border-radius: 4px |
|
||||||
box-shadow: 0 6px 12px rgba(0,0,0,.175) |
|
||||||
|
|
||||||
.uib-typeahead-match |
|
||||||
padding: 10px 5px |
|
||||||
word-break: break-word |
|
||||||
|
|
||||||
&.active |
|
||||||
background: $primary-color-dark |
|
||||||
|
|
||||||
a |
|
||||||
color: $font-color-on-primary-dark |
|
||||||
|
|
||||||
|
|
||||||
.typeahead-autocomplete |
|
||||||
// Error highlighting |
|
||||||
&.-error, &.-error:hover, &.-error:focus |
|
||||||
background: $nm-color-error-background |
|
||||||
border-color: $nm-color-error-border |
|
@ -0,0 +1,14 @@ |
|||||||
|
<li ng-attr-data-value="{{ ::value }}" class="ui-menu-item"> |
||||||
|
<div class="ui-menu-item-wrapper"> |
||||||
|
<a href |
||||||
|
tabindex="-1" |
||||||
|
ng-attr-title="{{ ::watcher.name}}"> |
||||||
|
<img ng-attr-src="{{ ::watcher.avatar }}" |
||||||
|
ng-attr-alt="{{ ::watchername }}" |
||||||
|
ng-show="watcher.avatar" |
||||||
|
class="avatar-mini"> |
||||||
|
<span class="work-package--watcher-name" |
||||||
|
ng-bind="::value"></span> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
</li> |
@ -1,52 +0,0 @@ |
|||||||
//-- copyright
|
|
||||||
// OpenProject is a project management system.
|
|
||||||
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License version 3.
|
|
||||||
//
|
|
||||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
|
||||||
// Copyright (C) 2006-2013 Jean-Philippe Lang
|
|
||||||
// Copyright (C) 2010-2013 the ChiliProject Team
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License
|
|
||||||
// as published by the Free Software Foundation; either version 2
|
|
||||||
// of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
//
|
|
||||||
// See doc/COPYRIGHT.rdoc for more details.
|
|
||||||
//++
|
|
||||||
|
|
||||||
import {wpDirectivesModule} from '../../../angular-modules'; |
|
||||||
|
|
||||||
function opFullWidthTypeahead( $timeout ) { |
|
||||||
return { |
|
||||||
restrict: 'A', |
|
||||||
require: 'uibTypeahead', |
|
||||||
link: function(scope, element, attrs, $select) { |
|
||||||
const watchOn = attrs['typeaheadIsOpen']; |
|
||||||
|
|
||||||
if (!watchOn) { |
|
||||||
throw "Missing typeahead-is-open on typeahead directive!"; |
|
||||||
} |
|
||||||
|
|
||||||
scope.$watch(watchOn, (isOpen) => { |
|
||||||
if (isOpen) { |
|
||||||
angular.element('#' + element.attr('aria-owns')).width(element.outerWidth()); |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
}; |
|
||||||
} |
|
||||||
|
|
||||||
wpDirectivesModule.directive('opFullwidthTypeahead', opFullWidthTypeahead); |
|
||||||
|
|
@ -1,10 +0,0 @@ |
|||||||
<a href |
|
||||||
tabindex="-1" |
|
||||||
ng-attr-title="{{match.label}}"> |
|
||||||
<img ng-attr-src="{{ match.model.avatar }}" |
|
||||||
ng-attr-alt="{{ match.model.name }}" |
|
||||||
ng-show="match.model.avatar" |
|
||||||
class="avatar-mini"> |
|
||||||
<span class="work-package--watcher-name" |
|
||||||
ng-bind-html="match.label | uibTypeaheadHighlight:query"></span> |
|
||||||
</a> |
|
@ -1,15 +1,6 @@ |
|||||||
<form name="add_relation_form" class="form"> |
<form name="add_relation_form" class="form"> |
||||||
<input type="text" |
<input type="text" |
||||||
class="wp-relations--autocomplete typeahead-autocomplete" |
class="wp-relations--autocomplete ui-autocomplete--input" |
||||||
ng-class="{ '-error': noResults }" |
ng-class="{ '-error': noResults }" |
||||||
ng-model="selectedWp" |
placeholder="{{ ::text.placeholder }}"> |
||||||
op-fullwidth-typeahead |
|
||||||
typeahead-is-open="autocompleteIsOpen" |
|
||||||
typeahead-append-to-body="true" |
|
||||||
typeahead-on-select="onSelect($model)" |
|
||||||
typeahead-no-results="noResults" |
|
||||||
typeahead-wait-ms="100" |
|
||||||
typeahead-input-formatter="getIdentifier($model)" |
|
||||||
placeholder="{{ ::text.placeholder }}" |
|
||||||
uib-typeahead="item as getIdentifier(item) for item in autocompleteWorkPackages($viewValue)"> |
|
||||||
</form> |
</form> |
||||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@ |
|||||||
|
{ |
||||||
|
"resolution": "main", |
||||||
|
"tree": { |
||||||
|
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/ead8376ca80553332af7872f9fe723c6fbb4e412/jqueryui/index.d.ts", |
||||||
|
"raw": "registry:dt/jqueryui#1.11.0+20161214061125", |
||||||
|
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/ead8376ca80553332af7872f9fe723c6fbb4e412/jqueryui/index.d.ts" |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue