Skip to content
Permalink
Browse files

Added wing.scroll_to() in wing.vue.js.

  • Loading branch information...
rizen committed Jul 14, 2018
1 parent 41e7482 commit 46d7963262717e6467597c3914d6bbfa76c85c2d
Showing with 32 additions and 2 deletions.
  1. +3 −0 CHANGES.txt
  2. +2 −0 angular2vue.txt
  3. +17 −2 lib/Wing/WingVue.pod
  4. +10 −0 public/wing.vue.js
@@ -4,6 +4,9 @@ This file tracks the changes to Wing over time. Especially
with respect to new features and compatibility changes.
==========================================================

2018-07-14
* Added wing.scroll_to() in wing.vue.js.

2018-07-11
* wing.vue.js throws errors when apis are empty.

@@ -16,6 +16,8 @@ documentation.

* Vue 2 Filters - https://github.com/freearhey/vue2-filters

* Qs - https://github.com/ljharb/qs

* Axios - https://github.com/axios/axios

* Lodash - https://lodash.com/docs/
@@ -860,19 +860,34 @@ The message you want to be diplayed.

=head1 Utilities

=head2 wing.scroll_to(element)

Scroll the window to a particular element.

=over

=item element

The DOM element to scroll to. Use C<document.getElementById()> or some such.

=back

=head2 wing.get_query_param(name, [url])

Returns the value of a query param.

=head3 name
=over

=item name

The name of the parameter you wish to fetch.

=head3 url
=item url

Optional. Defaults to C<window.location.href>.

=back

=head2 wing.parse_date(input, timezone)

Takes any number of date-looking inputs, and converts them into a Moment.js object.
@@ -210,6 +210,16 @@ Vue.component('confirmation-toggle', {

const wing = {

/*
* scroll the window to an element
*/

scroll_to (el) {
var elbox = el.getBoundingClientRect();
var bodybox = document.body.getBoundingClientRect();
window.scroll(elbox.left - bodybox.left, elbox.top - bodybox.top);
},

/*
* base URI when you're working against a server that is not on your domain
*/

0 comments on commit 46d7963

Please sign in to comment.
You can’t perform that action at this time.