Show:

Q.Notice Class

Operates with notices.

Item Index

Properties

Methods

add

(
  • options
)

Adds a notice.

Parameters:

  • options Object

    Object of options

    • [key] String optional

      Unique key for this notice. Need if you want to modify/remove notice by key.

    • content String

      HTML contents of this notice.

    • [closeable=true] Boolean optional

      Whether notice can be closed with red x icon.

    • [handler] Function | String optional

      Something (callback or URL) to handle with Q.handle()

    • [type=common] String optional

      Arbitrary type of notice. Can be used to apply different styles dependent on type, because appropriate CSS class appended to the notice. May be 'error', 'warning'.

    • [timeout=false] Boolean | Number optional

      Time in seconds after which to remove notice.

    • [persistent=false] Boolean | Number optional

      Whether to save this notice to session to show after page refresh.

get

(
  • notice
)

Get a notice by key.

Parameters:

  • notice String | HTMLElement

    HTMLElement or key Unique key of notice which has been provided when notice was added. Or notice HTMLElement

hide

(
  • notice
)

Hides a notice.

Parameters:

  • notice String | HTMLElement

    HTMLElement or key Unique key of notice which has been provided when notice was added. Or notice HTMLElement

parseNotices

()

Parse notices loaded from backend.

remove

(
  • notice
)

Removes a notice.

Parameters:

  • notice String | HTMLElement

    HTMLElement or key Unique key of notice which has been provided when notice was added. Or notice HTMLElement

show

(
  • notice
)

Shows a previously notice.

Parameters:

  • notice String | HTMLElement

    HTMLElement or key Unique key of notice which has been provided when notice was added. Or notice HTMLElement

Properties

container

HTMLElement

Container for notices

popUpTime

Number

Setting that changes notices slide down / slide up time.

Default: 500