Commit Graph

118 Commits

Author SHA1 Message Date
Andrew
fc3865755f enhance(slideBox): fix selectedIndex bugs 2014-11-18 10:16:57 -07: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
Andrew
8b1bef3ea1 refactor(ionSlideBox): use live nodeList to preserve ordering 2014-11-05 13:52:12 -07:00
Perry Govier
8ee83777f7 fix(scroll): calling ionic scroll methods blur any selected input elements. Closes #2244 2014-10-27 16:45:01 -05:00
Andrew
950d697a70 style(slideBox): lower the speed a little bit 2014-10-09 10:18:36 -06:00
Andrew
d9cc7894d5 enhance(slideBox): re-add update() method 2014-10-09 09:52:51 -06:00
Andrew
01c829c351 feat(slideBox): use selected value provided for initial section
Addresses #2288.
2014-10-09 08:39:45 -06:00
Andrew
8228106145 demo(ionSlideBox): update demo 2014-10-08 16:22:15 -06:00
Andrew
7d2945f95d refactor(slideBox): make it so elements are properly removed 2014-10-08 16:10:28 -06:00
Andrew
0d2f54e6a9 fix(slideBox): do not require scroll parent 2014-10-08 15:56:23 -06: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
Adam Bradley
7cad00837d test(viewState): minor updates 2014-09-26 08:20:31 -05:00
Perry Govier
767ce6a3b4 fix(loading): prevent spinners in loading view from causing reflows when hidden. Closes #2013 2014-09-17 13:37:51 -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
b69aa5485f feat(splitView): expose side menu on large viewport
Ability to keep a left menu exposed on larger viewports, such as a
landscape tablet. Added the `expose-aside-menu` attribute directive.
2014-08-26 15:00:42 -05:00
Max Lynch
853fad19b1 New transition styles 2014-08-24 15:08:30 -05:00
Andrew
5d06c4aef8 feat(popover): support popping from bottom or top of screen
Closes #1986
2014-08-20 12:09:08 -06:00
Perry Govier
944a92b08d feat(templateCache): automatically cache template files to prevent flicker on page navigation and improve performance
State templates are cached automatically, but you can optionally cache other templates.
```js
$ionicTemplateCahce('myNgIncludeTemplate.html');
```

Optionally disable all preemptive caching with the `$ionicConfigProvider` or individual states by setting `prefetchTemplate`
in the $state definition
```js
$ionicTemplateCahce('myNgIncludeTemplate.html');
```js
  angular.module('myApp', ['ionic'])
  .config(function($stateProvider, $ionicConfigProvider) {

    // disable preemptive template caching globally
    $ionicConfigProvider.prefetchTemplates(false);

    // disable individual states
    $stateProvider
      .state('tabs', {
        url: "/tab",
        abstract: true,
        prefetchTemplate: false,
        templateUrl: "tabs-templates/tabs.html"
      })
      .state('tabs.home', {
        url: "/home",
        views: {
          'home-tab': {
            prefetchTemplate: false,
            templateUrl: "tabs-templates/home.html",
            controller: 'HomeTabCtrl'
          }
        }
      });
  });
```
2014-08-15 15:10:19 -05:00
Andrew
8c6d5f2c96 fix(collectionRepeat): simplify item reusing process to fix rare reuse error
Closes #1777.
2014-08-13 10:30:44 -06:00
Andrew
9bfa3bd18b fix(collectionRepeat): ignore spacing of hidden elements (ion-refresher)
Closes #1970
2014-08-11 10:06:31 -04:00
Andrew
7ddb57e60b feat(collectionRepeat): other children of ion-content element fit in
Closes #1920. Closes #1866. Closes #1380.
2014-08-06 10:32:40 -06:00
Adam Bradley
c1215aa300 feat(popover): created popovers 2014-07-31 14:43:29 -05:00
Andrew
537b29d0bb fix(toggle): fix ngChange being reported before model changes
Closes #1349, #1741

BREAKING CHANGE:

ion-toggle no longer has an isolate scope.
This will break your toggle only if you were relying upon the toggle
having an isolate scope: if you were referencing `$parent.value` as
the ng-disabled attribute, for example.

Change your code from this:

<ion-toggle ng-disabled="{{$parent.isDisabled}}"></ion-toggle>

To this:

<ion-toggle ng-disabled="{{isDisabled}}"></ion-toggle>
2014-07-10 23:51:55 -06:00
Perry Govier
bb6976ad54 feat(tab): options 'hidden' attribute for tabs. Closes #1666, #1673 2014-07-09 17:10:43 -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
ed4f22889e feat(ionModalView): ion-modal-view to wrap template instead of <div class="modal">
Closes #1668.

`<div class="modal">` will still work, but adding an `<ion-modal-view>`
element to wrap a modal template is a more "Ionic Looking" way of doing
the same thing.
2014-07-07 13:43:12 -06:00
Joilson Marques
8f8086092f feat(ionSlideBox): add 'auto-play' attr to optionally disable auto-play
Closes #1552
2014-07-07 13:14:58 -06:00
Andrew
e3db08563b fix(sideMenu): when drag-content=false, allow drag-to-close
Closes #1419
2014-07-07 12:42:51 -06:00
Andrew
22a81fe82c test(list): use timeout.flush() 2014-07-06 14:29:33 -06:00
MGMsystems
ba56bb983f feat(ionSideMenu): add edge-drag-threshold, delegate edgeDragThreshold()
Closes #1570
2014-07-06 14:22:26 -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
Perry Govier
889482e048 fix(tap): fire input behavior when tap/clicking file input label. Closes #1699 2014-07-02 18:27:07 -05:00
Perry Govier
704fe402e7 fix(radio): suport ng-disabled. Closes #1684 2014-06-27 15:58:17 -05:00
Perry Govier
3e6ce1831b fix(popup): if popup is taller than the window, shrink the popup body and make it scrollable. Closes #1679 2014-06-27 11:27:06 -05:00
Adam Bradley
39a2fb7892 test(viewState): move ion-nav-buttons location 2014-06-23 09:31:27 -05:00
Perry Govier
4a2296dcae fix(header): add iOS 8 support to iOS header fix. assumes all iOS will have 7 style headers. closes #1625 2014-06-18 16:16:44 -05:00
Andrew Joslin
b2585f19ca fix(collectionRepeat): fix scroll when item bigger than viewport
Closes #1621
2014-06-17 17:42:10 +00:00
Max Lynch
0e647e77af Holding off on platform tweaks just yet 2014-06-12 13:29:01 -05:00
Adam Bradley
90b4d34630 refactor(gestures): $event local and simplify init 2014-06-12 11:40:23 -05:00
Adam Bradley
a2dcaf13cc feat(gestures): added gesture directives
Closes #829
2014-06-12 10:49:07 -05:00
Andrew Joslin
cec3a42236 fix(ionNavBackButton): stop flicker when pressing back on ios 2014-06-11 16:07:38 -06:00
Max Lynch
c30be67f65 feat(platforms): Android and iOS Specific Styles and Transitions 2014-06-11 16:48:53 -05:00
Andrew Joslin
6af5d68da4 feat(collectionRepeat): huge optimization upgrades
Closes #1597
2014-06-10 17:56:35 -06:00
Allen Hernandez
1839158979 fix(test): Use HTML5 doctype on all tests. Closes #1539, #1524 2014-06-02 13:17:30 -05:00
Max Lynch
1c3dcc1922 Much better animation for ios
Fixed duration
2014-05-26 22:19:28 -05:00
Andrew Joslin
49f06f9c3d fix(scrollView): make xy scrolling work on ionScroll and ionContent
Closes #1462
2014-05-21 13:13:29 -06:00
Andrew Joslin
cc46735c82 fix(ionReorderButton): fix onReorder not triggering angular digest 2014-05-20 08:59:34 -06:00
Andrew Joslin
90e7395e62 fix($ionicLoading): do not flicker when showing long loading messages
Closes #1252
2014-05-14 10:48:43 -06:00
Andrew Joslin
df9c0747c9 fix(listView): reordering up is more responsive, fix scrolling error
Closes #1202
2014-05-14 08:39:13 -06:00