corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 /**
2 * @author: Dennis Hernández
3 * @webSite: http://djhvscf.github.io/Blog
4 * @version: v1.0.0
5 */
6  
7 (function ($) {
8 'use strict';
9  
10 var initResizable = function (that) {
11 //Deletes the plugin to re-create it
12 that.$el.colResizable({disable: true});
13  
14 //Creates the plugin
15 that.$el.colResizable({
16 liveDrag: that.options.liveDrag,
17 fixed: that.options.fixed,
18 headerOnly: that.options.headerOnly,
19 minWidth: that.options.minWidth,
20 hoverCursor: that.options.hoverCursor,
21 dragCursor: that.options.dragCursor,
22 onResize: that.onResize,
23 onDrag: that.options.onResizableDrag
24 });
25 };
26  
27 $.extend($.fn.bootstrapTable.defaults, {
28 resizable: false,
29 liveDrag: false,
30 fixed: true,
31 headerOnly: false,
32 minWidth: 15,
33 hoverCursor: 'e-resize',
34 dragCursor: 'e-resize',
35 onResizableResize: function (e) {
36 return false;
37 },
38 onResizableDrag: function (e) {
39 return false;
40 }
41 });
42  
43 var BootstrapTable = $.fn.bootstrapTable.Constructor,
44 _toggleView = BootstrapTable.prototype.toggleView,
45 _resetView = BootstrapTable.prototype.resetView;
46  
47 BootstrapTable.prototype.toggleView = function () {
48 _toggleView.apply(this, Array.prototype.slice.apply(arguments));
49  
50 if (this.options.resizable && this.options.cardView) {
51 //Deletes the plugin
52 $(this.$el).colResizable({disable: true});
53 }
54 };
55  
56 BootstrapTable.prototype.resetView = function () {
57 var that = this;
58  
59 _resetView.apply(this, Array.prototype.slice.apply(arguments));
60  
61 if (this.options.resizable) {
62 // because in fitHeader function, we use setTimeout(func, 100);
63 setTimeout(function () {
64 initResizable(that);
65 }, 100);
66 }
67 };
68  
69 BootstrapTable.prototype.onResize = function (e) {
70 var that = $(e.currentTarget);
71 that.bootstrapTable('resetView');
72 that.data('bootstrap.table').options.onResizableResize.apply(e);
73 }
74 })(jQuery);