Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
iOS application
Commits
37afc9c1
Commit
37afc9c1
authored
4 years ago
by
Ruben Daniels
Browse files
Options
Download
Email Patches
Plain Diff
fix filterpanel being auto closed
parent
31a6a863
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
memri/cvu/views/CascadableDict.swift
+13
-13
memri/cvu/views/CascadableDict.swift
memri/parsers/cvu-parser/CVUToString.swift
+2
-0
memri/parsers/cvu-parser/CVUToString.swift
memri/sessions/Session.swift
+3
-3
memri/sessions/Session.swift
with
18 additions
and
16 deletions
+18
-16
memri/cvu/views/CascadableDict.swift
+
13
-
13
View file @
37afc9c1
...
...
@@ -8,21 +8,21 @@ import Foundation
import
SwiftUI
import
RealmSwift
public
class
CascadableDict
:
Cascadable
,
CustomStringConvertible
,
Subscriptable
{
class
ItemReference
{
let
uid
:
Int
let
type
:
Item
.
Type
init
(
to
:
Item
)
{
uid
=
to
.
uid
.
value
??
-
1
type
=
to
.
getType
()
??
Item
.
self
}
func
resolve
()
->
Item
?
{
DatabaseController
.
read
{
$0
.
object
(
ofType
:
type
,
forPrimaryKey
:
uid
)
}
}
class
ItemReference
{
let
uid
:
Int
let
type
:
Item
.
Type
init
(
to
:
Item
)
{
uid
=
to
.
uid
.
value
??
-
1
type
=
to
.
getType
()
??
Item
.
self
}
func
resolve
()
->
Item
?
{
DatabaseController
.
read
{
$0
.
object
(
ofType
:
type
,
forPrimaryKey
:
uid
)
}
}
}
public
class
CascadableDict
:
Cascadable
,
CustomStringConvertible
,
Subscriptable
{
func
get
<
T
>
(
_
name
:
String
,
type
:
T
.
Type
=
T
.
self
)
->
T
?
{
guard
let
value
=
cascadeProperty
(
name
,
type
:
Any
?
.
self
)
else
{
return
nil
...
...
This diff is collapsed.
Click to expand it.
memri/parsers/cvu-parser/CVUToString.swift
+
2
-
0
View file @
37afc9c1
...
...
@@ -26,6 +26,8 @@ class CVUSerializer {
return
p
.
toCVUString
(
depth
+
1
,
tab
)
}
else
if
let
p
=
p
as?
Item
,
let
uid
=
p
.
uid
.
value
{
return
"{{ item(
\(
p
.
genericType
)
,
\(
uid
)
) }}"
}
else
if
p
is
ItemReference
,
let
p
=
(
p
as?
ItemReference
)?
.
resolve
(),
let
uid
=
p
.
uid
.
value
{
return
"{{ item(
\(
p
.
genericType
)
,
\(
uid
)
) }}"
}
else
if
let
p
=
p
as?
Color
{
return
String
(
p
.
description
.
lowercased
()
.
prefix
(
7
))
}
else
if
let
p
=
p
as?
Double
{
...
...
This diff is collapsed.
Click to expand it.
memri/sessions/Session.swift
+
3
-
3
View file @
37afc9c1
...
...
@@ -190,7 +190,7 @@ public final class Session : Equatable, Subscriptable {
state
=
try
Cache
.
createItem
(
CVUStateDefinition
.
self
,
values
:
[:])
guard
let
uid
=
state
?
.
uid
.
value
else
{
throw
"Exception: could not create st
ored
definition"
throw
"Exception: could not create st
ate
definition"
}
self
.
uid
=
uid
...
...
@@ -225,7 +225,7 @@ public final class Session : Equatable, Subscriptable {
_
=
try
state
?
.
link
(
s
,
type
:
"view"
,
sequence
:
.
last
,
overwrite
:
false
)
}
else
{
debugHistory
.
warn
(
"Unable to store view. Missing st
ored
CVU"
)
debugHistory
.
warn
(
"Unable to store view. Missing st
ate
CVU"
)
}
}
}
...
...
@@ -285,7 +285,7 @@ public final class Session : Equatable, Subscriptable {
// hide filterpanel if view doesnt have a button to open it
if
showFilterPanel
{
if
currentView
?
.
filterButtons
.
first
(
where
:
{
$0
.
name
==
.
toggleFilterPanel
})
!
=
nil
{
if
currentView
?
.
filterButtons
.
first
(
where
:
{
$0
.
name
==
.
toggleFilterPanel
})
=
=
nil
{
showFilterPanel
=
false
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment