Permalink
Browse files

NestedList: Add the possibility to customize an entry.

  • Loading branch information...
jecisc committed Jan 6, 2017
1 parent feaba43 commit 9421917a3cf7bd26fdb3167f9b11a3c62af452ab
@@ -0,0 +1,3 @@
accessing
entryCustomizationHook: anObject
entryCustomizationHook := anObject
@@ -0,0 +1,3 @@
accessing
entryCustomizationHook
^ entryCustomizationHook
@@ -0,0 +1,3 @@
rendering
hasCustomizationForEntry
^ self entryCustomizationHook notNil
@@ -2,20 +2,23 @@ rendering
renderItemContentOf: aNode index: anIndex indentedBy: anInteger on: html
| anId div |
anId := html nextId.
(div := html div)
class: #itemContener;
div := html div class: #itemContener.
self hasCustomizationForEntry
ifTrue: [ self entryCustomizationHook value: div value: aNode element ].
div
attributeAt: 'draggable' put: 'true';
attributeAt: 'onDragOver' put: 'if("' , anIndex asString , '" != event.dataTransfer.getData("sourceIndex")) {event.preventDefault();}';
attributeAt: 'onDragOver'
put: 'if("' , anIndex asString , '" != event.dataTransfer.getData("sourceIndex")) {event.preventDefault();}';
attributeAt: 'ondrop' put: 'dropListItem(event, "' , anIndex asString , '");';
attributeAt: 'ondragstart' put: 'dragListItem(event,"' , anIndex asString , '")';
style: 'padding-left: ' , (15 * anInteger) asString , 'px;';
class: #isSelected if: aNode selectedElement;
with: [ self renderIconOf: aNode element on: html.
self
renderAnchor: aNode
withId: anId
index: anIndex
inDiv: div
indentedBy: anInteger
on: html ].
self renderHelpOf: aNode element at: anId on: html
with: [
self renderIconOf: aNode element on: html.
self
renderAnchor: aNode
withId: anId
index: anIndex
inDiv: div
indentedBy: anInteger
on: html ]
@@ -7,6 +7,7 @@
"commentStamp" : "CyrilFerlciot 5/18/2016 01:05",
"instvars" : [
"elements",
"entryCustomizationHook",
"filteredElements",
"format",
"actionBlock",

0 comments on commit 9421917

Please sign in to comment.