Commit Graph

340 Commits

Author SHA1 Message Date
Adam Bradley
811cc2725a fix(listView): do not scroll freeze when no scrollView
Closes #3174
2015-03-04 12:07:05 -06:00
Andrew
bb866da3d7 refactor(collection-repeat): performance 2015-02-24 13:24:51 -07:00
Adam Bradley
be09433608 fix(scroll): fix IE mousewheel scroll 2015-02-13 09:21:26 -06:00
Adam Bradley
9a88c4179d feat(scroll): freeze scroll on ion-option-button swipe
Closes #2950
2015-02-12 09:01:50 -06:00
Adam Bradley
e8a70f3701 fix(scroll): do not click when scroll decelerating
Closes #1438, #2223, #2665
2015-02-09 14:04:57 -06:00
Andrew
40b3a6ad97 amend(ionItem): make sure option buttons hide instantly for collectionRepeat 2015-02-06 16:50:15 -07:00
Adam Bradley
8ebde73d0b feat(swipe): iOS swipe to go back 2015-02-06 16:29:50 -06:00
perry
7134114bd5 feat(refresher): Allow refrsher to work with native scrolling
This update allows `<ion-refresher>` to work with native scrolling. Native scrolling can be enabled in the state deffinition, through the `$ionicConfigProvider` like `$ionicConfig.scrolling.jsScrolling(false);` or in the controller directly. It should function exactly the same as with JS scrolling enabled.

This is a merge of the wip-scrolling branch.
2015-02-05 11:41:53 -06:00
Andrew
7fec8480e5 fix(ionItem): properly hide option buttons on scroll in collection-repeat
Closes #1811. Closes #2804.
2015-02-05 09:45:37 -07:00
Max Lynch
7557c58ea6 fix(listView): ionic.extend not extend 2015-02-04 10:36:27 -06:00
Max Lynch
93643c4127 fix(scrollView): higher velocity threshold for sliding 2015-02-04 09:58:58 -06:00
Adam Bradley
223d89624d style(): main angular references 2015-02-02 20:49:04 -06:00
Adam Bradley
955f44110b feat(pullToRefresh): add on-pull-progress
Add the ability to get the progress of a user’s pull to refresh, while
they’re pulling down the refresher.
2015-01-05 08:17:11 -06:00
Wesley Cho
25e173acc1 bug(scroll)
Fix IE10 scroll issue. This addresses #2728
2014-12-15 09:29:20 -08:00
Max Lynch
9f437a8c2b fix(scroll): ion-scroll swallows scroll events by default. Fixes #2695 2014-12-12 15:11:28 -06:00
Andrew
2910f508a9 refactor(): put old sliderView back 2014-12-09 14:51:48 -07:00
Adam Bradley
c35d69115e refactor(scrollView): do not update if not rendered 2014-12-09 15:27:06 -06:00
Adam Bradley
12bb8de55e fix(modal): focus on inputs under keyboard 2014-12-06 22:44:02 -06:00
Wesley Cho
0a8eb3914f fix(scrollView): make mousewheel events firefox-compatible
Closes #2616
2014-12-01 16:41:47 -07:00
Andrew
037d2c368e fix(scrollView): fix null pointer exception on scrollbar 2014-12-01 10:58:44 -07:00
Jamie Sutherland
41d85f7a0a fix(SlideDrag) clears drag when list is scrolled or new drag starts
This also fixes the broken $ionicListDelegate.clearOptionButtons() method.

Makes lists feel more natural inline with iOS functionality and fixes issues
with using ion-option-buttons with collection repeat
2014-11-15 20:24:19 +00:00
Adam Bradley
3c4f15c748 fix(listView): unchecked null pointer 2014-11-12 09:42:50 -06:00
Adam Bradley
39951ca99a refactor(): navigation improvements, Angular 1.3
#### Refactor:

* **Navigation:** Refactored navigation for improved performance,
reduce DOM manipulations, increase transition FPS, cached views,
smoother transitions, platform specific transitions with added
configurable controls for transition animation and direction.
* **Cached Views:** Previously as a user navigated an app, each leaving
view’s element and scope would be destroyed. If the same view was
accessed again then the app would have to recreate the element. Views
can now be cached to improve performance. When a view is navigated away
from, its element is left in the DOM, and its scope is disconnected
from the cycle. When navigating to a view which is already cached, its
scope is reconnected, and the existing element which was left in the
DOM becomes the active view. This also allows for scroll position of
previous views to be maintained (without skippy jumps). Config
variables can be used to disable view caching (set to 0), or change the
maximum number of views to cache.
* **Angular v1.3:** Upgraded Ionic’s to work with Angular v1.3. In
general Ionic just works with the upgrade, but the required change was
that animations in v1.3 uses promise, whereas in v1.2 animations used
callbacks.

#### Features:

* **Platform Specific Transitions:** Transitions between views now
default to the transition style appropriate for each platform. For
example, iOS will move forward by transitioning the entering view from
right to center, and the leaving view from center to left. However,
Android will transition with the entering view going from bottom to
center, covering the previous view, which remains stationary. Platform
transitions are automatically applied by default, but config variables
and custom CSS allows these defaults to be easily overridden.
* **Override Transition Type and Direction:** As a user navigates the
app, Ionic automatically applies the appropriate transition type for
the platform, and the direction the user is navigating. However, both
can be overridden in numerous ways: config variable, view attribute,
stateProvider property, or attribute on the button/link that initiated
the transition.
* **enable-menu-with-back-views:** The `enable-menu-with-back-views`
attribute determines if the side menu is enabled when the back button
is showing. When set to `false`, any buttons/links with the
`menuToggle` directive will be hidden, and the user cannot swipe to
open the menu. When going back to the root page of the side menu (the
page without a back button visible), then any menuToggle buttons will
show again, and menus will be enabled again.
* **menuClose:** Closes a side menu which is currently opened.
Additionally, the menuClose directive will now cause transitions to not
animate between views while the menu is being closed.
* **ionNavBackButton:** The back button icon and text will
automatically update to platform config defaults, such as adjusting to
the platform back icon. To take advantage of this, the
`ionNavBackButton` directive now should be empty, such as
`<ion-nav-back-button></ion-nav-back-button>`. The back button can
still be fully customized like it could before, but without any inner
content it knows to style using platform configs.
* **navBar button primary/secondary sides:** Primary and secondary
sides are now the recommended values for the `side` attribute, such as
`<ion-nav-buttons side="primary">`. Primary buttons generally map to
the left side of the header, and secondary buttons are generally on the
right side. However, their exact locations are platform specific. For
example, in iOS the primary buttons are on the far left of the header,
and secondary buttons are on the far right, with the header title
centered between them. For Android however, both groups of buttons are
on the far right of the header, with the header title aligned left.
Recommendation is to always use `primary` and `secondary` so buttons
correctly map to the side familiar to users of a platform. However, in
cases where buttons should always be on an exact side, both `left` and
`right` sides are still available.
* **navDirection:** An attribute directive that sets the direction
which the nav view transition should animate.
* **navTransition:** An attribute directive that sets the transition
type which the nav view transition should use when it animates. Using
`none` will disable an animation.

#### Breaking Changes:

* **Animation CSS:** The CSS for view transitions have changed. This is
a breaking change only if Ionic apps had customized Ionic’s animation
CSS.
* **$ionicPlatformDefaults:** Platform config variables are no longer
in the $ionicPlatformDefaults constant, but within `$ionicConfig`.
* **$ionicViewService:** In the navigation refactoring,
$ionicViewService was split up into two factories, `$ionicViewSwitcher`
and `$ionicHistory`. The `$ionicHistory` is largely what
`$ionicViewService`, but between the two factories there is a better
separation of concerns for improved testing.
* **navClear:** The navClear directive was created to do what the new
side menu `enable-menu-with-back-views` attribute accomplishes.
Additionally, the new `navTransition` and `navDirection` directives are
more useful and granular than the navClear directive.
* **scrollView.rememberScrollPosition:** This method has been removed
since it is no longer needed with cached views.

#### Deprecated:

* **ionView.title:** The `ionView` directive used the `title`
attribute, but this can cause the tooltip to show up on desktop
browsers. The `title` attribute will still work for backwards
compatibility, but we now recommend using `view-title`, such as
`<ion-view view-title=”My Title”>`.
* **ionNavView animation attribute removed:** The animation attribute
is no longer used for nav views. Instead use `$ionicConfig`.
* **ionNavBar animation attribute removed:** The animation attribute is
no longer used for nav bars. Instead use `$ionicConfig`.
2014-11-11 14:43:10 -06:00
Adam Bradley
b69cad8b84 refactor(scrollBar): rAF scrollbar transitions
Only make changes to the scrollbar element’s style when there is a
change, and use requestAnimationFrame when there is a change.
2014-11-10 21:11:07 -06:00
Adam Bradley
2deec085bb refactor(headerBarView): find title by class, not h1 tag 2014-10-09 20:17:29 -05:00
Adam Bradley
9985efaa52 chore(listView): cleanup element references 2014-10-09 20:15:56 -05:00
Adam Bradley
6385452303 refactor(scrollView): only update DOM on changes
On line 1188 and 1094, only make updates to the content element’s
transform style when there are actual DOM changes that need to be made,
instead of accessing the DOM just to set the same value. Also many
style() updates.
2014-10-09 20:11:48 -05:00
Andrew
7ef9ad74cf fix(slidebox): refactor for performance and stability
Closes #2336. Closes #2317. Closes #2290. Closes #2228. Closes #2067.
Closes #1890. Closes #1865. Closes #1850. Closes #1755. Closes #1688.
Closes #1578. Closes #1501. Closes #1353. Closes #1342. Closes #782.
Closes #416. Closes #2288.

BREAKING CHANGE: The slideBox's API has undergone many changes.

- **`<ion-slide-box>`** attributes have changed (see
  [documentation](http://ionicframework.com/docs/api/directive/ionSlideBox)):

  * `active-slide` has changed to `selected`. Change your code from
  this:

    ```html
    <ion-slide-box active-slide="activeSlideIndex"></ion-slide-box>
    ```

    To this:

    ```html
    <ion-slide-box selected="activeSlideIndex"></ion-slide-box>
    ```

  * `does-continue` has changed to `loop`.  Change your code from this:

    ```html
    <ion-slide-box does-continue="shouldLoop"></ion-slide-box>
    ```

    To this:

    ```html
    <ion-slide-box loop="shouldLoop"></ion-slide-box>
    ```

  * `auto-play` and `slide-interval` have been merged into `auto-play`.
  Change your code from this:

    ```html
    <!-- autoPlay is on -->
    <ion-slide-box auto-play="true" slide-interval="1000">
    </ion-slide-box>
    <!-- autoPlay is off -->
    <ion-slide-box auto-play="false" slide-interval="1000">
    </ion-slide-box>
    ```

    To this:

    ```html
    <!-- autoPlay is on -->
    <ion-slide-box auto-play="1000"></ion-slide-box>
    <!-- autoPlay is off -->
    <ion-slide-box auto-play="false"></ion-slide-box>
    ```

  * `show-pager` and `pager-click` have been removed. Use
  a child `<ion-slide-pager>` element. See the [`ion-slide-pager`
  documentation](http://ionicframework.com/docs/api/directive/ionSlidePager).
  Change your code from this:

  ```html
  <!-- pager using default click action -->
  <ion-slide-box show-pager="true">
  </ion-slide-box>
  <!-- pager with custom click action -->
  <ion-slide-box show-pager="true" pager-click="doSomething(index)">
  </ion-slide-box>
  ```

  To this:

  ```html
  <ion-slide-box>
    <!-- pager using default click action -->
    <ion-slide-pager></ion-slide-pager>
  </ion-slide-box>
  <ion-slide-box>
    <!-- pager with custom click action -->
    <ion-slide-pager ng-click="doSomething(index)"></ion-slide-pager>
  </ion-slide-box>
  ```

- **`$ionicSlideBoxDelegate`** methods have changed (see
  [documentation](http://ionicframework.com/docs/api/service/$ionicSlideBoxDelegate)):

  - `update()` has been removed. slideBox updates on its own now.

  - `stop()` has been removed. See `autoPlay()` below.

  - `start()` hass been removed. See `autoPlay()` below.

  - `slide(newIndex[, speed])` has been renamed to `select(newIndex[,
    speed]);

  - `currentIndex()` has been renamed to `selected()`.

  - `slidesCount()` has been renamed to `count()`.

  - New method `$ionicSlideBoxDelegate.autoPlay()`. Change your code
    from this:

    ```js
    // stop auto sliding
    $ionicSlideBoxDelegate.stop();
    // later... start auto sliding
    $ionicSlideBoxDelegate.start();
    ```

    To this:

    ```js
    var autoPlaySpeed = 3000; //wait 3000 seconds between changing slide
    // stop auto sliding
    $ionicSlideBoxDelegate.autoPlay(false);
    // later... start auto sliding
    $ionicSlideBoxDelegate.autoPlay(autoPlaySpeed);
    ```

  - `previous()` now returns the index of the previous slide and does
    not select. Change your code from this:

    ```js
    // select previous slide
    $ionicSlideBoxDelegate.previous();
    ```

    To this:

    ```js
    // select previous slide
    $ionicSlideBoxDelegate.select( $ionicSlideBoxDelegate.previous() );
    ```
  - `next()` now returns the index of the next slide and does
    not select. Change your code from this:

    ```js
    // select next slide
    $ionicSlideBoxDelegate.next();
    ```

    To this:

    ```js
    // select next slide
    $ionicSlideBoxDelegate.select( $ionicSlideBoxDelegate.next() );
    ```
2014-10-08 11:09:15 -06:00
Perry Govier
84f18a1c6e fix(content): don't resize content on keyboard open if it's inside a modal. Fixes #2212 2014-10-06 14:56:35 -05:00
Perry Govier
8787760aad fix(pull to refresh): minor optimization to prevent flicker on deactivate 2014-09-25 15:47:26 -05:00
Adam Bradley
03086ed228 fix(nav): prevent flickers between views
By default the scroll bar is being created for each view, then
immediately it adds the .scroll-bar-fade-out class. On every transition
you sometimes saw the scroll bar appear then fade away quickly. Sure
that was annoying and has been fixed to prevent that, but the real
issue is that on every view transition, the scroll bar’s opacity
transition fired off a transitionend event, which bubbled up to the
view and messed with Angular’s $animate. If timed out correctly, at the
time the scroll bar’s transitionend event bubbled up, and an element
was actively leaving the view, it would confuse $animate and cause the
leave animation to abruptly end, which caused an ugly flicker.
2014-09-16 22:58:22 -05:00
Perry Govier
e608bada6d amend(refresher): fix for if height is unknowable, and earlier commit changes lost in scrollView 2014-09-16 22:55:13 -05:00
Perry Govier
db27fb116c feat(refresher): Improve refresher animation. Allow pulling icon rotation to be disabled. 2014-09-16 16:22:02 -05:00
Adam Bradley
74de015c22 fix(keyboard): android scroll stuck
When a state change happens, ensure the keyboard is hidden. When a
keyboard is hidden, ensure all pending timers our cleared. When
resetting scrollView, ensure it’s only doing it when it has to.
For testing: #1670 #2192
2014-09-14 23:18:57 -05:00
Adam Bradley
8883c6ccc5 fix(scroll): ensure scrollView objects exist
Check if scrollView is null when switching off of tabs view. #2181
2014-09-12 23:05:28 -05:00
Adam Bradley
ba3600dfb4 fix(scroll): calculate padding-bottom
Closes #2174
2014-09-10 12:24:10 -05:00
Justin Basinger
f89f010cce fix(scrollview, content): Fixed multiple memory leaks in scrollview and content 2014-09-08 12:21:49 -05:00
Adam Bradley
b31f4e8e3f refactor(sideMenu): move controller logic to $ionicSideMenus 2014-08-20 11:09:48 -05:00
Perry Govier
6f5b6c24c6 fix(reorder): reorder drag threshold are equal for going up and down. Closes #1394 2014-08-19 17:24:02 -05:00
Andrew
d18f0f77cd test(view): amend some broken tests 2014-08-18 09:30:13 -06:00
Andrew
c5966bba05 fix(scrollView): resolve memory leaks with holding element references
Addresses #1993
2014-08-18 09:01:29 -06:00
Perry Govier
c336e8ede8 fix(refresher): finish animating before changing icon, hide when not in use 2014-08-07 17:54:30 -05:00
Adam Bradley
944d2595af fix(sideMenu): fix stopping content scrolling
When a list was within a side menu it could scroll up and down, but if
the user happened to drag a little bit on the X axis, then it would try
to open the side menu and the Y scroll of the content stopped. Closes
#1541
2014-08-07 12:22:28 -05:00
Adam Bradley
abf77a1cf0 style(): spaces man, spaces 2014-08-06 20:37:03 -05:00
Andrew
4f10a72306 fix(list): make reorder/delete button animation work well on all devices 2014-07-08 11:32:43 -06:00
Andrew
1c789f8a88 fix(scrollView): always stay exactly within boundaries after bounce
Closes #1736
2014-07-07 12:18:20 -06:00
Andrew
ba1859b308 fix(ionReorderButton): stop ngRepeat:dupes error when reordering
Closes #1601.

BREAKING CHANGE: Reordering with ion-reorder-button no longer changes the order of the items in the DOM.

This change will only break your list if you were not using the
onReorder callback as described in the documentation.

Before, while reordering an element in a list Ionic would swap the
elements underneath as the reordering happened.  This sometimes caused
errors with angular's ngRepeat directive.

Now, reordering an element in a list does not change the order of
elements in the DOM.  It is expected that the end developer will use the
index changes given in the `onReorder` callback to reorder the items
in the list. This is simple to do, see the [examples in the
ionReorderButton
documentation](http://ionicframework.com/docs/api/directive/ionReorderButton/).
2014-07-06 13:39:56 -06:00
Sergii Iushchuk
0dad2ed6e8 fix(sliderView): "getBoundClientRect" typo 2014-07-04 19:56:28 -06:00
Andrew
86ce480696 fix(sliderView): find width properly when element is transformed
Fixes #1313
2014-06-24 09:39:03 +09:00
Adam Bradley
96b2243f15 fix(scroll): safari scroll content height
Safari and Chrome have two different opinions of what `scrollHeight`
means. It appears Safari is not taking into account that the parent
element can have padding applied which changes the scrollHeight. Closes
#1411
2014-06-17 10:52:52 -05:00