Skip to content

Commit

Permalink
Merge branch 'main' into feature/per_session_data
Browse files Browse the repository at this point in the history
  • Loading branch information
Alyxion authored Apr 7, 2024
2 parents 06d6393 + 815c88c commit bb6f44b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nicegui/elements/echart.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
run_chart_method(name, ...args) {
if (name.startsWith(":")) {
name = name.slice(1);
args = args.map((arg) => new Function("return " + arg)());
args = args.map((arg) => new Function(`return (${arg})`)());
}
return runMethod(this.chart, name, args);
},
Expand Down
2 changes: 1 addition & 1 deletion nicegui/elements/json_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
if (this.editor) {
if (name.startsWith(":")) {
name = name.slice(1);
args = args.map((arg) => new Function("return " + arg)());
args = args.map((arg) => new Function(`return (${arg})`)());
}
return runMethod(this.editor, name, args);
}
Expand Down
4 changes: 2 additions & 2 deletions nicegui/elements/leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default {
run_map_method(name, ...args) {
if (name.startsWith(":")) {
name = name.slice(1);
args = args.map((arg) => new Function("return " + arg)());
args = args.map((arg) => new Function(`return (${arg})`)());
}
return runMethod(this.map, name, args);
},
Expand All @@ -135,7 +135,7 @@ export default {
if (layer.id !== id) return;
if (name.startsWith(":")) {
name = name.slice(1);
args = args.map((arg) => new Function("return " + arg)());
args = args.map((arg) => new Function(`return (${arg})`)());
}
result = runMethod(layer, name, args);
});
Expand Down
3 changes: 3 additions & 0 deletions nicegui/native/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def set_window_size(self, width: int, height: int) -> None:
def resize(self, width: int, height: int, fix_point: FixPoint = FixPoint.NORTH | FixPoint.WEST) -> None:
self._send(width, height, fix_point)

def maximize(self) -> None:
self._send()

def minimize(self) -> None:
self._send()

Expand Down
2 changes: 1 addition & 1 deletion nicegui/static/utils/dynamic_properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function convertDynamicProperties(obj, recursive) {
for (const [attr, value] of Object.entries(obj)) {
if (attr.startsWith(":")) {
try {
obj[attr.slice(1)] = new Function("return " + value)();
obj[attr.slice(1)] = new Function(`return (${value})`)();
delete obj[attr];
} catch (e) {
console.error(`Error while converting ${attr} attribute to function:`, e);
Expand Down

0 comments on commit bb6f44b

Please sign in to comment.