Skip to content

Commit

Permalink
Bootstrap 3.0 support
Browse files Browse the repository at this point in the history
* new class: Bootstrap.Affix and the associated behavior
* Popovers (and tooltips if you like) can now have their 'trigger' option set to 'click' which allows you to show them on click instead of mouseover if you like.
* Delegator.BS.ShowPopup now allows you to just use a #href reference to the id of the popup to show.
* Dropdown now allows for you to have its behavior on the Dropdown itself instead of a container.
* Bootstrap.Popup now expects that the layout matches Bootstrap 3. *This is a breaking change* but compatibility has been left in place for Bootstrap 2. For this to work, you must set `Bootstrap.version = 2` in your code.
* Bootstrap.Popover's offset defaults are now zero unless `Bootstrap.version` == 2
  • Loading branch information
anutron committed Sep 1, 2013
1 parent 775e9e5 commit 6d47f2e
Show file tree
Hide file tree
Showing 45 changed files with 25,207 additions and 14,413 deletions.
22 changes: 22 additions & 0 deletions Docs/Behaviors/Behavior.BS.Affix.md
@@ -0,0 +1,22 @@
Behavior Filter: Behavior.BS.Affix
===================================

A behavior filter to instantiate [Bootstrap](http://twitter.github.com/bootstrap/#affix) Affix functionality.

### Demo / Fancy Docs

[http://anutron.github.com/mootools-bootstrap/#affix](http://anutron.github.com/mootools-bootstrap/#affix)


### Example

<a data-behavior="BS.Affix"
data-affix-options="
'top': 10
">I stick around!</a>

### Options

* top - (*number*) The distance from the top that the user must scroll before the affix class is added and the affix-top class is removed. Defaults to 0.
* bottom - (*number*) The distance from the top that the user must scroll before the affix class is removed and the affix-bottom class is added. Specify a negative number to have it measure from the bottom of the window height.
* classNames - (*object*) The class names to apply in the various states. Defaults to `top: "affix-top", bottom: "affix-bottom", affixed: "affix"`. These should be defined in your CSS as you like. You can also manually affix location for the element using the events listed below.
91 changes: 91 additions & 0 deletions Docs/UI/Bootstrap.Affix.md
@@ -0,0 +1,91 @@
Class: Bootstrap.Affix {#Bootstrap-Affix}
=============================

Implements the basic functionality of [Bootstrap](http://anutron.github.com/mootools-bootstrap/#tooltip) Affix which adds a class to an element when it is above, in, and below a given scroll range.

### Implements

- [Options][]
- [Events][]

Bootstrap.Affix Method: constructor
-----------------------------

### Syntax

new Bootstrap.Affix(element[, options]);

### Arguments

1. element - (*mixed*) A string of the id for an Element or an Element that should be changed when the window scrolls.
2. options - (*object*, optional) a key/value object of options

### Options

* top - (*number*) The distance from the top that the user must scroll before the affix class is added and the affix-top class is removed. Defaults to 0.
* bottom - (*number*) The distance from the top that the user must scroll before the affix class is removed and the affix-bottom class is added. Specify a negative number to have it measure from the bottom of the window height.
* classNames - (*object*) The class names to apply in the various states. Defaults to `top: "affix-top", bottom: "affix-bottom", affixed: "affix"`. These should be defined in your CSS as you like. You can also manually affix location for the element using the events listed below.

### Events

* pin - (*function*) Fired when the element is below the top and above the bottom (i.e. it is within the scroll boundaries).
* unPin - (*function*) Fired when the element is out of scroll range. If it is below the bottom of the range, this event is passed a boolean `true`.

Bootstrap.Affix Method: attach {#Bootstrap-Affix:attach}
------------------------------------------------

Attach scroll listeners (enable the instance).

### Syntax

myAffix.attach();

### Returns

* (*object*) This Bootstrap.Affix instance.

Bootstrap.Affix Method: detach {#Bootstrap-Affix:detach}
------------------------------------------------

Detaches the scroll listeners (disables the instance).

### Syntax

myAffix.detach();

### Returns

* (*object*) This Bootstrap.Affix instance.

Bootstrap.Affix Method: pin {#Bootstrap-Affix:pin}
------------------------------------------------

Fires the pin event and adds the pinned-state class.

### Syntax

myAffix.pin();

### Returns

* (*object*) This Bootstrap.Affix instance.

Bootstrap.Affix Method: unpin {#Bootstrap-Affix:unpin}
------------------------------------------------

Fires the unPin event and adds the unpinned-state class.

### Syntax

myAffix.unpin([isBottom]);

### Arguments

1. isBottom - (*boolean*) if `true` adds the bottom-state class. Otherwise the top.

### Returns

* (*object*) This Bootstrap.Affix instance.

[Options]: http;//mootools.net/core/Class/Class.Extras#Options
[Events]: http;//mootools.net/core/Class/Class.Extras#Events
2 changes: 1 addition & 1 deletion Docs/UI/Bootstrap.Tooltip.md
Expand Up @@ -34,7 +34,7 @@ Bootstrap.Tooltip Method: constructor
* override - (*string*) The tip value used instead of the `title` value of the target element.
* offset - (*number* or *object*) The offset of the tip. If a number, will be used for the y offset for `top` and `bottom` located tips, x for `left` and `right` located tips. If an object, should contain `.y` and/or `.x` numerical values. Defaults to `0`.
* title - (*string*) The element property to use for the tip value. Defaults to `title`.
* trigger - (*string*) The event type to attach to the target element to show the tip. Choose from `hover`, `focus`, or `manual`.
* trigger - (*string*) The event type to attach to the target element to show the tip. Choose from `hover`, `focus`, `click`, or 'manual'.
* onOverflow - (*boolean*) Only show the tip if the element's content is overflown (i.e. it's scroll-height or scroll-width is greater than the height or width of the element). Defaults to `false`.
* getContent - (*function*) A function that returns the tip value. By default, it retrieves the value of the `title` option from the target element.

Expand Down
Binary file removed Examples/.DS_Store
Binary file not shown.
Binary file removed Examples/img/glyphicons-halflings-white.png
Binary file not shown.

0 comments on commit 6d47f2e

Please sign in to comment.