Skip to content

Commit

Permalink
Changes on main filename
Browse files Browse the repository at this point in the history
- Added testrunner. Uses gulpjs.
- Removed usage of .bind and replaced with $.proxy
  • Loading branch information
sydcanem committed Apr 16, 2014
1 parent 34aba8f commit 46d0b87
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 2 additions & 2 deletions contextmenu.js → bootstrap-contextmenu.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Bootstrap Context Menu
* Version: 2.0
* Version: 0.2.0
* Author: @sydcanem
* https://github.com/sydcanem/bootstrap-contextmenu
*
Expand Down Expand Up @@ -57,7 +57,7 @@
$menu.attr('style', '')
.css(tp)
.addClass('open')
.on('click.context.data-api', items, this.onItem.bind(this, $(e.currentTarget)))
.on('click.context.data-api', items, $.proxy(this.onItem, this, $(e.currentTarget)))
.trigger('shown.bs.context', relatedTarget);

// Delegating the `closemenu` only on the currently opened menu.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bootstrap-contextmenu",
"main": "bootstrap-contextmenu.js",
"version": "1.0.0",
"version": "0.2.0",
"homepage": "https://github.com/sydcanem/bootstrap-contextmenu",
"authors": [
"sydcanem <icqhv.santos@gmail.com>"
Expand Down
7 changes: 7 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require('gulp'),
qunit = require('gulp-qunit');

gulp.task('test', function () {
return gulp.src('./test/qunit.html')
.pipe(qunit());
});
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h3>Via Javascript</h3>
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://codeorigin.jquery.com/jquery-1.10.2.min.js"></script>
<script src="contextmenu.js"></script>
<script src="bootstrap-contextmenu.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.js"></script>
<script type="text/javascript">
// Demo 2
Expand Down
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "bootstrap-contextmenu",
"version": "0.2.0",
"description": "Context-menu extension for Twitter's Bootstrap framework",
"main": "bootstrap-contextmenu.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "gulp test"
},
"repository": {
"type": "git",
"url": "git://github.com/sydcanem/bootstrap-contextmenu.git"
},
"keywords": [
"bootstrap"
],
"author": "James Santos",
"license": "MIT",
"bugs": {
"url": "https://github.com/sydcanem/bootstrap-contextmenu/issues"
},
"homepage": "https://github.com/sydcanem/bootstrap-contextmenu",
"devDependencies": {
"gulp": "^3.6.0",
"gulp-qunit": "^0.3.3"
}
}
4 changes: 2 additions & 2 deletions test/qunit.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<!-- QUnit -->
<link rel="stylesheet" href="vendor/qunit.css" media="screen">
<script src="vendor/qunit.js"></script>
<script src="../contextmenu.js"></script>
<script src="../bootstrap-contextmenu.js"></script>
<!-- Unit tests -->
<script src="unit/contextmenu.js"></script>
<script src="unit/bootstrap-contextmenu.js"></script>

</head>
<body>
Expand Down
File renamed without changes.

0 comments on commit 46d0b87

Please sign in to comment.