Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
fix(select): prefix attributes with 'w11k-select' to make IE happy again
Browse files Browse the repository at this point in the history
IE has a problem with the 'disabled' attribute on the element containing the 'w11k-select' directive. The attribute prevents the drop-down-content from scrolling its overflow.

BREAKING CHANGE:
All attributes used by 'w11k-select' directive has to be prefixed with 'w11k-select-' now.

Use
```
<div w11k-select
     w11k-select-multiple="true"
     w11k-select-disabled="disabled"
     w11k-select-options="option.value as option.label for option in options.data"
     w11k-select-placeholder="'All'"
     w11k-select-filter-placeholder="'Filter'"
     w11k-select-required="false"
     ng-model="selected.data"
     name="demoField"
     >
</div>
```

instead of
```
<div w11k-select
     multiple="true"
     disabled="disabled"
     options="option.value as option.label for option in options.data"
     placeholder="'All'"
     filter-placeholder="'Filter'"
     required="false"
     ng-model="selected.data"
     name="demoField"
     >
</div>
```
  • Loading branch information
Philipp Burgmer committed May 27, 2014
1 parent f4aa7f2 commit cdb21df
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/w11k-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ angular.module('w11k.select').directive('w11kSelect', [
replace: false,
templateUrl: w11kSelectConfig.templateUrl,
scope: {
isMultiple: '=?multiple',
isRequired: '=?required',
isDisabled: '=?disabled'
isMultiple: '=?w11kSelectMultiple',
isRequired: '=?w11kSelectRequired',
isDisabled: '=?w11kSelectDisabled'
},
require: 'ngModel',
link: function (scope, element, attrs, controller) {
Expand Down Expand Up @@ -155,7 +155,7 @@ angular.module('w11k.select').directive('w11kSelect', [
}

// read the placeholder attribute once
var placeholderAttrObserver = attrs.$observe('placeholder', function (placeholder) {
var placeholderAttrObserver = attrs.$observe('w11kSelectPlaceholder', function (placeholder) {
if (angular.isDefined(placeholder)) {
header.placeholder = scope.$eval(placeholder);
updateHeader();
Expand All @@ -168,7 +168,7 @@ angular.module('w11k.select').directive('w11kSelect', [
});

// read the selected-message attribute once
var selectedMessageAttrObserver = attrs.$observe('selectedMessage', function (selectedMessage) {
var selectedMessageAttrObserver = attrs.$observe('w11kSelectSelectedMessage', function (selectedMessage) {
if (angular.isDefined(selectedMessage)) {
header.selectedMessage = scope.$eval(selectedMessage);
updateHeader();
Expand All @@ -181,7 +181,7 @@ angular.module('w11k.select').directive('w11kSelect', [
});

// read the select-filtered-text attribute once
var selectFilteredTextAttrObserver = attrs.$observe('selectFilteredText', function (selectFilteredText) {
var selectFilteredTextAttrObserver = attrs.$observe('w11kSelectSelectFilteredText', function (selectFilteredText) {
if (angular.isDefined(selectFilteredText)) {
var text = scope.$eval(selectFilteredText);
var span = angular.element(element[0].querySelector('.select-filtered-text'));
Expand All @@ -195,7 +195,7 @@ angular.module('w11k.select').directive('w11kSelect', [
});

// read the deselect-filtered-text attribute once
var deselectFilteredTextAttrObserver = attrs.$observe('deselectFilteredText', function (deselectFilteredText) {
var deselectFilteredTextAttrObserver = attrs.$observe('w11kSelectDeselectFilteredText', function (deselectFilteredText) {
if (angular.isDefined(deselectFilteredText)) {
var text = scope.$eval(deselectFilteredText);
var span = angular.element(element[0].querySelector('.deselect-filtered-text'));
Expand Down Expand Up @@ -264,7 +264,7 @@ angular.module('w11k.select').directive('w11kSelect', [
};

// read the filter-placeholder attribute once
var filterPlaceholderAttrObserver = attrs.$observe('filterPlaceholder', function (filterPlaceholder) {
var filterPlaceholderAttrObserver = attrs.$observe('w11kSelectFilterPlaceholder', function (filterPlaceholder) {
if (angular.isDefined(filterPlaceholder)) {
scope.filter.placeholder = scope.$eval(filterPlaceholder);

Expand Down Expand Up @@ -345,7 +345,7 @@ angular.module('w11k.select').directive('w11kSelect', [
* options
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

var optionsExp = attrs.options;
var optionsExp = attrs.w11kSelectOptions;
var optionsExpParsed = optionParser.parse(optionsExp);

function collection2options(collection, viewValue) {
Expand Down

0 comments on commit cdb21df

Please sign in to comment.