Moving between pages.
This commit is contained in:
parent
ce54a9ac28
commit
2f4898f3f7
@ -1,5 +0,0 @@
|
||||
Class {
|
||||
#name : #GfLeSnippet,
|
||||
#superclass : #Object,
|
||||
#category : #LepiterPlugins
|
||||
}
|
@ -4,5 +4,29 @@ Extension { #name : #LeSnippet }
|
||||
LeSnippet >> index [
|
||||
| uuids |
|
||||
uuids := self parent children collect: [:each | each uidString ].
|
||||
^ uuids
|
||||
uuids doWithIndex: [ :unId :i |
|
||||
unId = self uidString ifTrue: [ ^ i ]
|
||||
]
|
||||
]
|
||||
|
||||
{ #category : #'*LepiterPlugins' }
|
||||
LeSnippet >> moveFrom: originPage to: destinationPage [
|
||||
| db origin thisSnippet destination |
|
||||
db := self page database.
|
||||
destination := db pageNamed: destinationPage.
|
||||
origin := db pageNamed: originPage.
|
||||
thisSnippet := origin children at: self index.
|
||||
origin removeSnippet: thisSnippet.
|
||||
destination addSnippet: thisSnippet.
|
||||
]
|
||||
|
||||
{ #category : #'*LepiterPlugins' }
|
||||
LeSnippet >> moveTo: pageName [
|
||||
| db origin destination thisSnippet |
|
||||
thisSnippet := self snippetModel.
|
||||
db := self page database.
|
||||
destination := db pageNamed: pageName.
|
||||
origin := db pageNamed: thisSnippet page title.
|
||||
origin removeSnippet: thisSnippet.
|
||||
destination addSnippet: thisSnippet.
|
||||
]
|
||||
|
@ -1,5 +0,0 @@
|
||||
Class {
|
||||
#name : #LepiterPlugin,
|
||||
#superclass : #Object,
|
||||
#category : #LepiterPlugins
|
||||
}
|
Loading…
Reference in New Issue
Block a user