Skip to content

Commit 3a31b51

Browse files
committed
compresses images
1 parent e855824 commit 3a31b51

File tree

9 files changed

+50
-3
lines changed

9 files changed

+50
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ A grid builder for Bootstrap 3.
77
Licensed under the Apache License v2.0
88
http://www.apache.org/licenses/LICENSE-2.0
99

10-
<!-- For 2.3.3 Refer http://jaykanakiya.com/bootstrap-grid-builder-2-3-2/-->
11-
1210
TO BE DONE :-
11+
1312
<ul>
1413
<li>Html generation should be done via $compile and should be instant</li>
1514
<li>Implement push-pull classes of bootstrap 3</li>
15+
<li>Implement Grid Builder for 2.3.2</li>
1616
</ul>

css/devices/imac.png

-206 KB
Loading

css/devices/ipad_land_black.png

-24.1 KB
Loading

css/devices/ipad_port_black.png

-21.1 KB
Loading

css/devices/iphone5_land_black.png

-83.3 KB
Loading

css/devices/iphone5_port_black.png

-103 KB
Loading

index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ <h4 class="modal-title">Bootstrap Grid Builder</h4>
111111
</div><!-- /.modal-dialog -->
112112
</div><!-- /.modal -->
113113

114-
114+
<script type="text/javascript" src="js/jquery-draggable.min.js"></script>
115+
<script type="text/javascript">
116+
$(document).ready(function () {
117+
$('#toolbar').drags();
118+
})
119+
</script>
115120
<script async defer type="text/javascript" src="js/prism.js"></script>
116121
</body>
117122
</html>

js/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,5 @@ app.controller('gridCtrl',function ($scope) {
333333
http://stackoverflow.com/questions/12430820/accessing-clicked-element-in-angularjs
334334
http://stackoverflow.com/questions/15458609/angular-js-how-to-execute-function-on-page-load
335335
http://stackoverflow.com/questions/17982561/using-angular-templates-to-generate-exportable-html
336+
http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/
336337
*/

js/jquery-draggable.min.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
(function($) {
2+
$.fn.drags = function(opt) {
3+
4+
opt = $.extend({handle:"",cursor:"move"}, opt);
5+
6+
if(opt.handle === "") {
7+
var $el = this;
8+
} else {
9+
var $el = this.find(opt.handle);
10+
}
11+
12+
return $el.css('cursor', opt.cursor).on("mousedown", function(e) {
13+
if(opt.handle === "") {
14+
var $drag = $(this).addClass('draggable');
15+
} else {
16+
var $drag = $(this).addClass('active-handle').parent().addClass('draggable');
17+
}
18+
var z_idx = $drag.css('z-index'),
19+
drg_h = $drag.outerHeight(),
20+
drg_w = $drag.outerWidth(),
21+
pos_y = $drag.offset().top + drg_h - e.pageY,
22+
pos_x = $drag.offset().left + drg_w - e.pageX;
23+
$drag.css('z-index', 1000).parents().on("mousemove", function(e) {
24+
$('.draggable').offset({
25+
top:e.pageY + pos_y - drg_h,
26+
left:e.pageX + pos_x - drg_w
27+
}).on("mouseup", function() {
28+
$(this).removeClass('draggable').css('z-index', z_idx);
29+
});
30+
});
31+
e.preventDefault(); // disable selection
32+
}).on("mouseup", function() {
33+
if(opt.handle === "") {
34+
$(this).removeClass('draggable');
35+
} else {
36+
$(this).removeClass('active-handle').parent().removeClass('draggable');
37+
}
38+
});
39+
40+
}
41+
})(jQuery);

0 commit comments

Comments
 (0)