mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
components: fix jQuery find proxy
This commit is contained in:
parent
e916eab13b
commit
2981816d07
|
|
@ -7,7 +7,8 @@ class BasePicker
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
|
||||
this.picker = null;
|
||||
this.input_element = null;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ class barcodescanner
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
|
||||
// init component
|
||||
this.LiveVideoSizeAdjusted = false;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class batterycard
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope; \n\tthis.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
}
|
||||
|
||||
Refresh(batteryId)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ class calendarcard
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope; \n\tthis.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
|
||||
this.$('#calendar').datetimepicker(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class chorecard
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope; \n\tthis.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
}
|
||||
|
||||
Refresh(choreId)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ class datetimepicker
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
|
||||
this.basename = basename;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ class numberpicker
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
var self = this;
|
||||
|
||||
this.$(".numberpicker-down-button").unbind('click').on("click", () => self.valueDownHandler(this));
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ class productamountpicker
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
|
||||
Grocy.Use("numberpicker");
|
||||
this.AllowAnyQuEnabled = false;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ class productcard
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
this.PriceHistoryChart = null;
|
||||
var self = this;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ class userfieldsform
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
this.$ = scopeSelector != null ? (selector) => this.scope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
|
||||
this.$(".userfield-link").keyup();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@ class GrocyFrontendHelpers
|
|||
{
|
||||
this.Grocy = Grocy;
|
||||
this.Api = Api;
|
||||
var self = this;
|
||||
if (scope != null)
|
||||
{
|
||||
this.$scope = $(scope).find;
|
||||
this.scope = $(scope);
|
||||
this.$scope = (selector) => self.scope.find(selector);
|
||||
this.scopeSelector = scope;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user