-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
define([ | ||
'bootstrap/modal', 'bootstrap/tooltip', 'bootstrap/transition' | ||
], function () { | ||
return { | ||
start: function () { | ||
$('#with-tooltip').tooltip({ | ||
placement: 'right', | ||
title: 'Hello from tooltip!' | ||
}); | ||
|
||
$('#show-modal').on('click', function () { | ||
$('#modal').modal('show'); | ||
}); | ||
|
||
$('#modal .btn-primary').on('click', function () { | ||
$('#modal').modal('hide'); | ||
}) | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require.config({ | ||
paths: { | ||
jquery: '../bower_components/jquery/jquery' | ||
}, | ||
packages: [ | ||
'bootstrap', { | ||
name: 'bootstrap', | ||
location: '../bower_components/bootstrap/js' | ||
} | ||
], | ||
shim: { | ||
bootstrap: ['jquery'] | ||
} | ||
}); | ||
|
||
require(['jquery', 'app'], function ($, app) { | ||
$(function () { | ||
app.start(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "09 Bootstrap", | ||
"version": "0.0.1", | ||
"homepage": "https://github.com/jelz/10-things-about-amd", | ||
"authors": [ | ||
"Jakub Elzbieciak <[email protected]>" | ||
], | ||
"license": "MIT", | ||
"private": true, | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"requirejs": "~2.1.8", | ||
"bootstrap": "~3.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>09 Bootstrap</title> | ||
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>09 Bootstrap</h1> | ||
<button class="btn btn-primary" id="show-modal">Show modal</button> | ||
<button class="btn btn-default" id="with-tooltip">It has tooltip</button> | ||
</div> | ||
|
||
<div class="modal fade" id="modal"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
<h4 class="modal-title">Welcome to modal!</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<p>Whoops, nothing there.</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> | ||
<button type="button" class="btn btn-primary">Save (nothing)</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
<script src="bower_components/requirejs/require.js" | ||
data-main="app/main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters