new (require("bajaux/mixin/responsiveMixIn"))(target, conditions)
- Description:
Applies the
responsivemixin to the target Widget.This mixin provides responsive layout for a widget based upon its dimensions.
It does this by adding or removing CSS classes to/from the widget's DOM element.The mixin injects itself by cross cutting the widget's layout behavior.
As of Niagara 4.8, omit the
conditionsargument to use a set of default
classes:phone-only: less than 600px widetablet-portrait-up: 600px wide or greatertablet-landscape-up: 900px wide or greaterdesktop-up: 1200px wide or greater
- Source:
Extends:
Examples
Apply responsive layout to a widget
var ResponsiveWidget = function () {
Widget.apply(this, arguments);
responsiveMixIn(this, {
'my-css-class-to-use-when-small': { maxHeight: 768, maxWidth: 1024 },
'my-css-class-to-use-when-square': function (info) { return info.width === info.height; }
});
};
ResponsiveWidget.prototype = Object.create(Widget.prototype);
ResponsiveWidget.prototype.doInitialize = function (dom) {
dom.addClass('ResponsiveWidget');
dom.html(myHtmlTemplate());
};
// in css:
// .ResponsiveWidget.my-css-class-to-use-when-small {
// background-color: white;
// }
Use a set of default classes
// ...
responsiveMixIn(this);
// in css:
// .ResponsiveWidget.tablet-portrait-up {
// display: flex;
// flex-flow: row wrap;
// }
// .ResponsiveWidget.tablet-landscape-up {
// flex-flow: row nowrap;
// }
Parameters:
| Name | Type | Description |
|---|---|---|
target |
module:bajaux/Widget | The widget to apply the mixin to. |
conditions |
Object.<String, (module:bajaux/mixin/responsiveMixIn~ResponsiveCondition|module:bajaux/mixin/responsiveMixIn~ResponsiveCallback)> | An |
Extends
Methods
applyParams(paramsopt) → {Promise}
- Description:
Can re-apply certain params that can also be passed to the constructor.
- Source:
- Since:
- Niagara 4.10
- Inherited From:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
Properties
|
Returns:
promise to be resolved after any
setEnabled/setReadonly work is done. Note that these functions will not
be called if the value of enabled/readonly is not actually changing.
- Type
- Promise
canApplyResponsiveClass(className, mediaInfoopt) → {Boolean}
- Description:
Returns true if the class can be added/removed to/from a widget's
DOM element.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
className |
String | The name of the class to test for. |
||
mediaInfo |
module:bajaux/mixin/responsiveMixIn~ResponsiveMediaInfo |
<optional> |
this.getResponsiveMediaInfo()
|
The widget media info. |
Returns:
Returns true if all the conditions for applying
the class are met.
- Type
- Boolean
changed(name, value) → {Promise}
- Description:
Called whenever a Widget's Property is changed.
If this Widget is not yet initialized, this is a no-op.
This function should not typically be overridden.
doChanged() should be overridden
instead.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String | The name of the Property that's changed. |
value |
* | The new Property value. |
Returns:
- Type
- Promise
cleanupDom()
- Description:
Called to clean up the DOM when the widget is being destroyed.
This method can be overridden if DOM clean up needs to be
handled in a different way.
- Source:
- Inherited From:
destroy(paramsopt) → {Promise}
- Description:
Indicates that a widget is no longer needed and is in the process of being
removed. In this function, subclasses can deallocate any resources, event
handlers, etc. that they may be holding. Delegates the actual work to
doDestroy.This method will not typically be overridden.
doDestroy()should be
overridden instead.Triggers a
bajaux:destroyorbajaux:destroyfailevent, as appropriate.Please note, after
doDestroyhas resolved, the DOM will be emptied,
all event handlers will be removed and the 'widget' data stored on the
DOM element will be deleted.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
object |
<optional> |
optional parameters to be passed to |
Returns:
A promise to be resolved when the widget has been
destroyed
- Type
- Promise
doChanged(name, value) → {Promise|*}
- Description:
Called by changed() when a Property
is changed.This method is designed to be overridden by any subclasses.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String | The name of the Property that's changed. |
value |
* | The new Property value. |
Returns:
- Type
- Promise | *
doDestroy(paramsopt) → {*|Promise}
- Description:
Called by
destroyso this widget has a chance to clean up after itself
and release any resources it is holding.Notably, any jQuery event handlers registered on child elements of the
widget's DOM element should be unregistered here. Also, you may want to
remove any CSS classes you've added to the widget's DOM element.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
Object |
<optional> |
Optional params object passed to |
Returns:
An optional promise that's resolved once the widget
has been destroyed.
- Type
- * | Promise
doEnabled(enabled) → {*|Promise}
- Description:
Called when the widget is enabled/disabled.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
enabled |
Boolean | the new enabled state. |
Returns:
An optional Promise that can be returned if
the state change is asynchronous.
- Type
- * | Promise
doInitialize(element, paramsopt) → {*|Promise}
- Description:
Performs the actual work of initializing the DOM element in which this
widget will live. This function should be overridden by subclasses - the
subclass function should append elements toelementas
necessary and then optionally return a promise.Most commonly, this will involve building up the HTML structure
necessary to load in a value. If this widget will display/edit a String,
for example,doInitializemight append a text input element to
the target element. ADynamicEnummight include a
<select>dropdown.In some cases, no initialization may be required at all. This
might be the case if you are binding the widget to an HTML element that is
already pre-populated with all the necessary structure to load a value,
or maybedoLoadwill empty out the element completely
and rebuild it from scratch every time a new value is loaded. In this
case, you do not need to override this method. (However, a widget that
overrides neitherdoInitializenordoLoadwill not be very useful!)Tip: the promises returned by
setEnabledandsetReadonlycan
only ever resolve afterinitializeitself resolves. So
return this.setEnabled(enabled)orreturn this.setReadonly(readonly)
fromdoInitializewill result in a deadlock that will never resolve.
They may be called, but not returned.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
element |
JQuery | The element in which this Widget should build its |
|
params |
Object |
<optional> |
Optional params object passed into |
Returns:
An optional promise to be resolved once the Widget
has initialized.
- Type
- * | Promise
doLayout(paramsopt) → {*|Promise}
- Description:
Called when the layout of the Widget changes. This method is designed
to be overridden.
- Source:
- Inherited From:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
* |
<optional> |
as of Niagara 4.10, any parameters passed to |
Returns:
This method may optionally return a promise once the
Widget has been laid out.
- Type
- * | Promise
doLoad(value, paramsopt) → {Promise}
- Description:
Performs the actual work of populating the widget's HTML to reflect the
input value.This function should be overridden by subclasses. The subclass function
should manipulate the DOM jq() and,
optionally,return a promise to indicate that the work of loading the value
has completed.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
* | The value to be loaded. |
|
params |
Object |
<optional> |
Optional params object passed to |
Returns:
An optional promise that's resolved once the widget has
loaded.
- Type
- Promise
doModified(modified)
- Description:
The actual implementation for
setModified. This function
should do any work necessary when the widget is set to a modified or
"dirty" state - typically enabling a save button, arming a
window.onbeforeunloadhandler, etc. Likewise, it should do
the opposite when setting modified to false.Note that this is synchronous, as is
setModified. Async work can be
performed, butsetModifiedwill not wait for it.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Description |
|---|---|---|
modified |
Boolean |
doRead() → {*|Promise}
- Description:
Does the work of reading the widget's current representation.
This might mean reading a series of text inputs and assembling their
values into an array. It might mean instantiating a copy of the backing
baja.Componentand setting slot values on the new copy.
It might mean simply returning the boolean value of a checkbox. If your
widget is composed of pure text/HTML and is not actually backed by an
external value, it might mean returning nothing.When saving a modified widget, the output of this function will be passed
directly into this widget's validation process, so all your validation
steps should be expecting to receive this. It will also be passed to
doSave, so yourdoSaveimplementation should also expect this value.The default behavior of
doReadis simply to use the widget's current
value.
- Source:
- Inherited From:
- See:
Returns:
The read value, or a promise to be resolved with the
read value
- Type
- * | Promise
doReadonly(readonly) → {*|Promise}
- Description:
Called when the widget is set to readonly or made writable.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
readonly |
Boolean | the new readonly state. |
Returns:
An optional Promise that can be returned if
the state change is asynchronous.
- Type
- * | Promise
doSave(validValue, paramsopt) → {*|Promise}
- Description:
Performs the actual work of saving the widget. This function should
be overridden by subclasses to save the value. The subclass function
should save the value and then, optionally, return a promise to indicate
that the work of saving the widget has completed.
- Source:
- Inherited From:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
validValue |
* | The value to be used for saving. This value will have |
|
params |
Object |
<optional> |
Optional params object passed to |
Returns:
An optional promise that's resolved once
the widget has saved.
- Type
- * | Promise
generateId() → {String}
- Description:
Generate a unique DOM ID. The ID will include the name of this widget's
constructor just for tracing/debugging purposes.
- Source:
- Inherited From:
Returns:
- Type
- String
getChildWidgets(paramsopt) → {Array.<module:bajaux/Widget>}
- Description:
Returns an array of child widgets living inside this editor's DOM.
This method will specifically not return child widgets of child widgets- for instance, if this widget has one child editor for a
baja.Facets,
you will only get a single widget back - it won't recurse down and give
you all the tag editors, type editors etc.
This is safer and easier than using
$.find(), which recurses down,
or carefully managing strings of$.children()calls.Pass in a
jQueryinstance to limit the child editor search to
a particular set of elements. Otherwise, will search all child elements
of this editor's DOM.If this editor has not initialized yet, you'll just get an empty array
back.The returned array will have some utility functions attached that return
promises. See example for details.- for instance, if this widget has one child editor for a
- Source:
- Since:
- Niagara 4.10
- Inherited From:
Examples
var kids = ed.getChildWidgets();
kids.setAllEnabled(false).then(function () {});
kids.setAllModified(false).then(function () {});
kids.setAllReadonly(false).then(function () {});
kids.readAll().then(function (valuesArray) {});
kids.validateAll().then(function (valuesArray) {});
kids.saveAll().then(function () {});
kids.destroyAll().then(function () {});
var stringEditors = ed.getChildWidgets({ type: StringEditor });
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | jQuery |
<optional> |
Properties
|
Returns:
an array of child widgets
- Type
- Array.<module:bajaux/Widget>
getCommandGroup() → {module:bajaux/commands/CommandGroup}
- Description:
Return the widget's command group.
- Source:
- Inherited From:
Returns:
getFormFactor() → {String}
- Description:
Return the widget's form-factor. The form-factor
is normally passed in from the Widget's constructor. However,
it can be set from a 'formFactor' property if required.A widget's form-factor typically doesn't change during a widget's
life-cycle.
- Source:
- Inherited From:
- See:
-
- module:bajaux/Widget.formfactor
Returns:
The form-factor.
- Type
- String
getResponsiveMediaInfo() → {module:bajaux/mixin/responsiveMixIn~ResponsiveMediaInfo}
- Description:
Return media information for the widget. This is used in deciding
whether to add/remove a CSS class to/from a widget when it's laid out.
The information will come from the widget's container, not the widget
itself. By default, it will look up the DOM hierarchy to find an element
with the classbajaux-widget-container, which will be provided to you
in most profiles (the HTML5 Hx Profile's content window, the element
containing a widget in a Px view, etc.). If none is found, will use the
dimensions of the browser window itself.This method returns width and height but could contain more properties
in future. Please note, any calculated pixel values should be
floored to the nearest integer.A developer can override this method to calculate the media information
differently.
- Source:
Returns:
The media information for the widget.
hasMixIn(mixin) → {Boolean}
- Description:
Return true if the widget implements the specified MixIn.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
mixin |
String | the name of the mixin to test for. |
Returns:
- Type
- Boolean
initialize(dom, paramsopt, layoutParamsopt) → {Promise}
- Description:
Initializes the DOM element to be bound to this Widget.
In a nutshell,
initializedefines the following contract:- After
initializecompletes and resolves its Promise, the target element will be fully
initialized, structured, and ready to load in a value. It will be accessible by calling
this.jq(). - If this is an editor,
loadmay not be called until
initialize's promise is resolved. Attempting
to load a value prior to initialization will result in failure. - This widget will be set as a jQuery data value on the initialized
DOM element. It can be retrieved by callingWidget.in(element).
initializedelegates the actual work of building the
HTML structure (if any) to thedoInitializefunction. When
subclassing Widget, you should not overrideinitialize.
doInitializeshould be overridden.After
initializecompletes, anbajaux:initializeor
bajaux:initializefailevent will be triggered, as appropriate.initializeis a one-time operation. It will always reject if the widget has already been
initialized once, or if it has been destroyed.- After
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
dom |
JQuery | The jQuery DOM element in which this widget should |
|
params |
* |
<optional> |
optional parameters object to be passed through to |
layoutParams |
* |
<optional> |
as of Niagara 4.10, optional parameters object to |
Returns:
A promise to be resolved once the widget has
initialized
- Type
- Promise
isDesignTime() → {Boolean}
- Description:
Returns true if the Widget is in a graphic design editor.
- Source:
- Inherited From:
Returns:
- Type
- Boolean
isDestroyed() → {Boolean}
- Description:
Return true if this Widget has already been destroyed. After destruction,
initialize()will always reject: the widget cannot be reused.
- Source:
- Inherited From:
Returns:
- Type
- Boolean
isEnabled() → {Boolean}
- Description:
Returns this widget's enabled state.
- Source:
- Inherited From:
- See:
Returns:
- Type
- Boolean
isInitialized() → {Boolean}
- Description:
Return true if this Widget is initialized.
- Source:
- Inherited From:
Returns:
- Type
- Boolean
isLoading() → {Boolean}
- Description:
Check if this widget is currently in the process of loading. This will
returntrueimmediately afterloadis called, and returnfalse
after theloadpromise resolves.
- Source:
- Inherited From:
Returns:
- Type
- Boolean
isModified() → {Boolean}
- Description:
Returns this widget's modified state.
- Source:
- Inherited From:
Returns:
- Type
- Boolean
isReadonly() → {Boolean}
- Description:
Returns this widget's readonly state.
- Source:
- Inherited From:
- See:
Returns:
- Type
- Boolean
jq() → {JQuery|null}
- Description:
Returns the jQuery DOM element in which this widget has been initialized.
Ifinitialize()has not yet been called, then this will returnnull.
- Source:
- Inherited From:
Returns:
the DOM element in which this widget has been
initialized, or null if not yet initialized.
- Type
- JQuery | null
layout(paramsopt) → {Promise}
- Description:
Overrides the bajaux Widget's
layoutmethod. This will add/remove
class names to/from a widget's DOM element depending on whether
its responsive conditions are met.
- Source:
- Overrides:
- See:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
* |
<optional> |
as of Niagara 4.10, any parameters passed to |
Returns:
- Type
- Promise
load(value, paramsopt) → {Promise}
- Description:
Updates the widget's HTML with the given value. An widget for editing a
string, for example, might load the string into a text input. A view for
editing aDynamicEnummight programmatically set a<select>
dropdown's value.load()may not be called untilinitialize()has completed its work.
Ifinitialize()is not finished,load()will reject.After
load()completes its work, the value loaded will be accessible
viathis.value().load()delegates the work of loading the HTML values todoLoad().
Subclasses will typically not overrideload, but more commonly will
overridedoLoad.After
load()completes, abajaux:loadorbajaux:loadfailevent will
be triggered, as appropriate.While this method is performing its work,
this.isLoading()will return
true.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
* | The value to be loaded |
|
params |
Object |
<optional> |
additional parameters to be passed to |
Returns:
A promise to be resolved with the loaded value after
the widget has been loaded, or rejected if the widget fails to load the
value.
- Type
- Promise
loadAndModify(value, paramsopt) → {Promise.<*>}
- Description:
Loads in a new value, and sets the widget modified as well. Use this
convenience method when you wish to load in a new value as if a user had
done it, thereby triggering the necessary modify event handlers.
- Source:
- Since:
- Niagara 4.12
- Inherited From:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
* | ||
params |
* |
<optional> |
Returns:
- Type
- Promise.<*>
properties() → {module:bajaux/Properties}
- Description:
Return the Properties for a widget.
- Source:
- Inherited From:
Returns:
The Properties for a widget.
read() → {Promise}
- Description:
Read the current representation of the widget. For instance, if the widget
is made up from two text input boxes, this might resolve an object with
two strings from those text boxes.Note the word "representation" - this function does not necessarily
return the widget's actual value, but might assemble a different
object, or array, or number, based on current user-entered values.readwill not typically be overridden.
doRead() should be overridden instead.
- Source:
- Inherited From:
- See:
Returns:
A promise that will be resolved with a value read from
the widget as specified by doRead, or rejected if the read fails.
- Type
- Promise
requestFocus()
- Description:
Attempts to place the cursor focus on this editor. For instance, if
showing a simple string editor in a dialog, it should request focus so
that the user can simply begin typing without having to move the mouse
over to it and click.Override this as necessary; by default, will place focus on the first
inputortextareaelement in this editor's element.
- Source:
- Since:
- Niagara 4.10
- Inherited From:
resolve(data, resolveParamsopt) → {Promise}
- Description:
Resolve a value from some data. Please note, this will not load the value
but will resolve some data that could then be loaded by the widget.By default, this will treat the data as an ORD so it can be resolved via
BajaScript.
- Source:
- Inherited From:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
* | String | baja.Ord | Specifies some data used to resolve a |
|
resolveParams |
Object |
<optional> |
An Object Literal used for ORD resolution. |
Returns:
a promise to be resolved with the value resolved from
the given data object
- Type
- Promise
save(paramsopt) → {Promise}
- Description:
Saves any outstanding user-entered changes to this widget. Triggers a
bajaux:saveorbajaux:savefailevent, as appropriate.In order to save the widget, its current value will be validated using
validate(), then the validated value will be passed todoSave().This method will not typically be overridden.
doSave() should be overridden instead.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
Object |
<optional> |
Additional parameters to be passed to |
Returns:
A promise to be resolved once the widget has been saved,
or rejected if the save fails.
- Type
- Promise
setCommandGroup(commandGroup)
- Description:
Set this widget's command group. Triggers a
bajaux:changecommandgroup
event.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
commandGroup |
module:bajaux/commands/CommandGroup |
setEnabled(enabled) → {Promise}
- Description:
Set this widget's enabled state.
Setting of the internal flag will be synchronous, so
isEnabledwill
return the expected value immediately after calling this function. However,
the actual work of updating the DOM cannot be performed until after the
widget has finished initializing, so this method will return a promise.This method will not typically be overridden.
doEnabled()should be
overridden instead.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Description |
|---|---|---|
enabled |
Boolean | the new enabled state |
Returns:
A promise to resolve immediately if initialize has
not yet been called, that will resolve once the work of initialize
followed by doEnabled have both been completed. It will reject if
initialize or doEnabled fail.
- Type
- Promise
setModified(modified)
- Description:
Sets this widget's modified or "dirty" status, to indicate that the user
has made changes to this widget that may need to be saved.The modification status will only be set if the widget is initialized
and the widget is not loading a new value.Triggers
bajaux:modifyorbajaux:unmodifydepending on the input value.
Any arguments passed to this function after the first will be passed
through to the triggered event.This method should not typically be overridden.
doModified() should be overridden
instead.
- Source:
- Inherited From:
- See:
Example
Say I have collection of nested widgets in my DOM element. Whenever one of those widgets is modified, I want to mark myself modified but also provide the originally modified editor. For example, when a Property Sheet is modified, I want to know which row caused the modification.
var that = this;
dom.on(events.MODIFY_EVENT, function (e, modifiedEd) {
that.setModified(true, modifiedEd);
return false;
});
Parameters:
| Name | Type | Description |
|---|---|---|
modified |
Boolean | * | (a non-Boolean will be checked for truthiness) |
setReadonly(readonly) → {Promise}
- Description:
Set this widget's readonly state.
Setting of the internal flag will be synchronous, so
isReadonlywill
return the expected value immediately after calling this function. However,
the actual work of updating the DOM cannot be performed until after the
widget has finished initializing, so this method will return a promise.This method will not typically be overridden.
doReadonly()should be
overridden instead.
- Source:
- Inherited From:
- See:
Parameters:
| Name | Type | Description |
|---|---|---|
readonly |
Boolean | the new readonly state. |
Returns:
A promise to resolve immediately if initialize has
not yet been called, that will resolve once the work of initialize
followed by doReadonly have both been completed. It will reject if
initialize or doReadonly fail.
- Type
- Promise
toDescription() → {Promise}
- Description:
Access the widget's icon asynchronously.
By default this will attempt to access the widget's icon from
the originating Lexicon. The Lexicon key should be in the format of
keyName.description. If an entry can't be found then a blank string
will be used.
- Source:
- Inherited From:
Returns:
A promise to be resolved with the widget's description
- Type
- Promise
toDisplayName() → {Promise}
- Description:
Access the widget's display name asynchronously.
By default, this will attempt to access the widget's display name from
the originating Lexicon. The Lexicon key should be in the format of
keyName.displayName. If an entry can't be found then the Type's
name will be used.
- Source:
- Inherited From:
Returns:
A promise to be resolved with the widget's display name
- Type
- Promise
toIcon() → {Promise}
- Description:
Access the widget's icon asynchronously.
By default, this will attempt to access the widget's description from
the originating Lexicon. The Lexicon key should be in the format of
keyName.icon. If an entry can't be found then a blank String will be
returned.
- Source:
- Inherited From:
Returns:
A promise to be resolved with the widget's icon URI.
- Type
- Promise
trigger()
- Description:
Trigger a widget event. By default, this fires a DOM event on the associated
widget's DOM element.
- Source:
- Inherited From:
validate() → {Promise}
- Description:
Read the current value from the widget and validate it.
- Source:
- Inherited From:
- See:
Returns:
A promise to be resolved with the value read from the
widget and passed through all validators, or rejected if the value could
not be read or validated.
- Type
- Promise
validators() → {module:bajaux/Validators}
- Description:
Return the widget's Validators.
- Source:
- Inherited From:
- See:
Returns:
value() → {*|null}
- Description:
Returns the widget's current loaded value. This the value that was last
loaded viaload(). To read a widget's current representation, reflecting
any user-entered changes, callread(). If no value has been loaded yet,
nullis returned.
- Source:
- Inherited From:
- See:
Returns:
the loaded value, or null if a value hasn't been
loaded yet.
- Type
- * | null
Type Definitions
ResponsiveCallback(info) → {boolean}
- Description:
A callback that returns true if the condition is met.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
info |
module:bajaux/mixin/responsiveMixIn~ResponsiveMediaInfo | The |
Returns:
true if the current media info satisfies the condition.
- Type
- boolean
ResponsiveCondition
- Description:
An object that defines some conditions for the associated class to be added
to the widget's DOM element.
- Source:
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
maxWidth |
Number |
<optional> |
The widget's width in pixels must be less |
maxHeight |
Number |
<optional> |
The widget's height in pixels must be less |
minWidth |
Number |
<optional> |
The widget's width in pixels must be greater |
minHeight |
Number |
<optional> |
The widget's height in pixels must be |
An object that defines some conditions for the associated class to be added
to the widget's DOM element.
Type:
- Object
ResponsiveMediaInfo
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
width |
number | The width in pixels to use in responsive layout. |
height |
number | The height in pixels to use in responsive layout. |
Type:
- Object