| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of html; | 5 part of html; |
| 6 | 6 |
| 7 /** A Set that stores the CSS class names for an element. */ | 7 /** A Set that stores the CSS class names for an element. */ |
| 8 abstract class CssClassSet implements Set<String> { | 8 abstract class CssClassSet implements Set<String> { |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 * [hasClass](http://api.jquery.com/hasClass/). | 29 * [hasClass](http://api.jquery.com/hasClass/). |
| 30 */ | 30 */ |
| 31 bool contains(String value); | 31 bool contains(String value); |
| 32 | 32 |
| 33 /** | 33 /** |
| 34 * Add the class [value] to element. | 34 * Add the class [value] to element. |
| 35 * | 35 * |
| 36 * This is the Dart equivalent of jQuery's | 36 * This is the Dart equivalent of jQuery's |
| 37 * [addClass](http://api.jquery.com/addClass/). | 37 * [addClass](http://api.jquery.com/addClass/). |
| 38 * | 38 * |
| 39 * If this corresponds to one element. Returns `true` if [value] was added to | 39 * If this corresponds to one element. Returns true if [value] was added to |
| 40 * the set, otherwise `false`. | 40 * the set, otherwise false. |
| 41 * | 41 * |
| 42 * If this corresponds to many elements, `null` is always returned. | 42 * If this corresponds to many elements, null is always returned. |
| 43 */ | 43 */ |
| 44 bool add(String value); | 44 bool add(String value); |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * Remove the class [value] from element, and return true on successful | 47 * Remove the class [value] from element, and return true on successful |
| 48 * removal. | 48 * removal. |
| 49 * | 49 * |
| 50 * This is the Dart equivalent of jQuery's | 50 * This is the Dart equivalent of jQuery's |
| 51 * [removeClass](http://api.jquery.com/removeClass/). | 51 * [removeClass](http://api.jquery.com/removeClass/). |
| 52 */ | 52 */ |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 return s; | 159 return s; |
| 160 } | 160 } |
| 161 | 161 |
| 162 void writeClasses(Set<String> s) { | 162 void writeClasses(Set<String> s) { |
| 163 List list = new List.from(s); | 163 List list = new List.from(s); |
| 164 _element.className = s.join(' '); | 164 _element.className = s.join(' '); |
| 165 } | 165 } |
| 166 } | 166 } |
| OLD | NEW |