Utils
Contents
Utils#
confirm#
- class confirm()#
- confirm.confirmModal(message, acceptCb, refuseCb, textYes="Ok", textNo="Cancel")#
Renders a modal dialog asking the user a yes/no question.
- Arguments
message (
String()
) – The message that the user will be askedacceptCb (
function()
) – Will be called if the user acceptsrefuseCb (
function()
) – Will be called if the user deniestextYes (
String()
) – Text to be displayed in the Yes buttontextNo (
String()
) – Text to be displayed in the No button
- Returns
View – The view that got instanced.
Examples:
var modal = Utils.confirmModal('Are you sure?', () => {}, () => {}, 'Sure', 'Not Really');
cssEscape#
- class cssEscape()#
- cssEscape.escape(string, escapeNonASCII=true)#
Escapes a string so it can be used for CSS classes
- Arguments
string (
String()
) – String to escapeescapeNonASCII (
Boolean()
) – Whether to escape non ASCII characters
- Returns
String – Escaped string
Examples:
var escaped = Utils.cssEscape.escape('foo');
facetParser#
itemModal#
- class itemModal()#
- itemModal.ItemModalOptions()#
- Arguments
project (
Model()
) – The project (this.project)collection (
Collection()
) – The item collection (for navigation)pdfPageJump (
Boolean()
) – Whether to jump to pdf first pagematching (
Boolean()
) – Whether to show matching pagesduplicates (
Boolean()
) – Whether to show duplicateswideModal (
Boolean()
) – Whether to make the modal widecustomTemplate (
Template()
) – Custom template for the modal content viewcustomTemplateParams (
Object()
) – Parameters object to pass into the custom template
- itemModal.open(item, options)#
Opens a item detail modal with custom parameters
- Arguments
item (
String()
) – Item to openoptions (
ItemModalOptions()
) – Options
Examples:
Utils.itemModal.open(item);