Skip to content

Commit

Permalink
Add jQuery temporarily to make old plugins usable
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff Kimball committed Oct 5, 2014
1 parent 3288ea8 commit fb2ef58
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"fastclick": "~1.0.3",
"angular": "~1.2.25",
"ui-router": "~0.2.11",
"angular-animate": "~1.2.25"
"angular-animate": "~1.2.25",
"jquery": "~2.1.1"
},
"version": "0.0.1",
"homepage": "https://github.com/zurb/foundation-apps",
Expand Down
18 changes: 0 additions & 18 deletions client/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ $('#newMessage').click(function() {
});
});

// Panels
$('[data-panel-toggle]').click(function() {
var targetPanel = $(this).attr('data-panel-toggle');
if (targetPanel.length === 0) {
$(this).closest('[data-panel]').toggleClass('is-active');
}
else {
$('#'+$(this).attr('data-panel-toggle')).toggleClass('is-active');
}
return false;
});

// Popup menus
$('[data-popup-toggle]').click(function() {
$(this).next('[data-popup]').toggleClass('is-active');
return false;
});

// $('*[data-motion-id="example1"]').on('click', function(e){
// e.preventDefault();
// $('#example1').toggleClass('motion');
Expand Down
2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ gulp.task('sass', ['clean', 'copy'], function() {
// Process Foundation JS
gulp.task('uglify', ['copy', 'clean'], function() {
var libs = [
'bower_components/jquery/dist/jquery.js',
'bower_components/fastclick/lib/fastclick.js',
'bower_components/viewport-units-buggyfill/viewport-units-buggyfill.js',
'bower_components/notify.js/notify.js',
'bower_components/tether/tether.js',
'js/foundation/**/*.js',
Expand Down
22 changes: 19 additions & 3 deletions js/foundation/foundation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,30 @@ FoundationApps = {
return null;
},
init: function() {
// Bein' hacky
$.fn.on = function() {};

FastClick.attach(document.body);
viewportUnitsBuggyfill.init();

this.modal.init();
this.offcanvas.init();
this.popup.init();

// The rest of the plugins
// Panels
$('[data-panel-toggle]').click(function() {
var targetPanel = $(this).attr('data-panel-toggle');
if (targetPanel.length === 0) {
$(this).closest('[data-panel]').toggleClass('is-active');
}
else {
$('#'+$(this).attr('data-panel-toggle')).toggleClass('is-active');
}
return false;
});

// Popup menus
$('[data-popup-toggle]').click(function() {
$(this).next('[data-popup]').toggleClass('is-active');
return false;
});
}
}

0 comments on commit fb2ef58

Please sign in to comment.