316f2b429f
Change-Id: I40508c686014f28772109fdfd10c68b986b40be6 Reviewed-on: https://dart-review.googlesource.com/25140 Reviewed-by: Terry Lucas <terry@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
27 lines
940 B
Plaintext
27 lines
940 B
Plaintext
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
part of $LIBRARYNAME;
|
|
|
|
$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
|
|
$!MEMBERS
|
|
|
|
// Override default options, since IE returns SelectElement itself and it
|
|
// does not operate as a List.
|
|
List<OptionElement> get options {
|
|
dynamic options = this.querySelectorAll<OptionElement>('option');
|
|
return new UnmodifiableListView(options.toList());
|
|
}
|
|
|
|
List<OptionElement> get selectedOptions {
|
|
// IE does not change the selected flag for single-selection items.
|
|
if (this.multiple) {
|
|
var options = this.options.where((o) => o.selected).toList();
|
|
return new UnmodifiableListView(options);
|
|
} else {
|
|
return [this.options[this.selectedIndex]];
|
|
}
|
|
}
|
|
}
|