mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Merge branch 'master' of https://github.com/driftyco/ionic
Conflicts: dist/css/ionic-scoped.css
This commit is contained in:
13
js/ext/angular/src/directive/ionicToggle.js
vendored
13
js/ext/angular/src/directive/ionicToggle.js
vendored
@ -8,28 +8,21 @@ angular.module('ionic.ui.toggle', [])
|
||||
replace: true,
|
||||
require: '?ngModel',
|
||||
scope: true,
|
||||
template: '<div class="toggle">' +
|
||||
' <input type="checkbox">'+
|
||||
' <div class="track">' +
|
||||
' <div class="handle"></div>' +
|
||||
' </div>' +
|
||||
'</div>',
|
||||
template: '<div class="toggle"><input type="checkbox"><div class="handle"></div></div>',
|
||||
|
||||
link: function($scope, $element, $attr, ngModel) {
|
||||
var checkbox, track, handle;
|
||||
var checkbox, handle;
|
||||
|
||||
if(!ngModel) { return; }
|
||||
|
||||
checkbox = $element.children().eq(0);
|
||||
track = $element.children().eq(1);
|
||||
handle = track.children().eq(0);
|
||||
|
||||
if(!checkbox.length || !track.length || !handle.length) { return; }
|
||||
if(!checkbox.length || !handle.length) { return; }
|
||||
|
||||
$scope.toggle = new ionic.views.Toggle({
|
||||
el: $element[0],
|
||||
checkbox: checkbox[0],
|
||||
track: track[0],
|
||||
handle: handle[0]
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user