List.append is not flexible enought
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu HTML5 UI SDK |
Triaged
|
Wishlist
|
Alexandre Abreu |
Bug Description
List.append(
- if only text ist set: <li><a href='#
- if text and label ist set: <li><a href='#
- if text, label and id ist set: <li id="$id"><a href='#
This method is however not flexible enought in practice. For example, it does not allow to add
- menu items with checkbox or switches
- menu items with image aside.
- menu items without right arrow ("i.e. withprogression")
- headers
Here are 3 suggestions that might be used instead
Alternativ 1:
===========
Declare a generic append method to add dom-element to a list:
list.append(
In this case the developer has to create himself the elements (with document.
Alternativ 2:
============
Declare several utility methods to append element:
list.appendHead
list.appendChec
list.appendSwit
list.appendText
...
list.appendItem
Alternative 3:
============
Allow the declaration of list items in the list-prototype. The API could look like that:
var checkbox = List.checkboxIt
var switch = List.switchItem
var text = List.textItem(
var header = List.header(
list.append(header, checkbox, switch, text);
Changed in ubuntu-html5-theme: | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Alexandre Abreu (abreu-alexandre) |
Changed in ubuntu-html5-theme: | |
importance: | Medium → Wishlist |