Skip to content

Commit 07dd731

Browse files
committed
Upgrade to release v4.1.0
1 parent bcc6dad commit 07dd731

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

css/fileinput.css

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
33
* @package bootstrap-fileinput
4-
* @version 4.1.0
4+
* @version 4.0.0
55
*
66
* File input styling for Bootstrap 3.0
77
* Built for Yii Framework 2.0
@@ -101,7 +101,7 @@
101101

102102
.file-preview-image {
103103
height: 160px;
104-
text-align: center;
104+
vertical-align: text-center;
105105
}
106106

107107
.file-preview-text {
@@ -112,13 +112,18 @@
112112
}
113113

114114
.file-preview-other {
115-
width: 160px;
116-
font-family: Monaco, Consolas, monospace;
117-
font-size: 11px;
118-
vertical-align: middle;
115+
padding-top: 48px;
119116
text-align: center;
120117
}
121118

119+
.file-preview-other i {
120+
font-size: 2.4em;
121+
}
122+
.file-other-error {
123+
width: 100%;
124+
padding-top: 30px;
125+
text-align:right
126+
}
122127
.file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file, .file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button {
123128
display: none;
124129
}
@@ -182,8 +187,4 @@
182187

183188
.file-icon-large {
184189
font-size: 1.2em;
185-
}
186-
187-
.kv-fileinput-error ul {
188-
margin: 3px 0;
189190
}

css/fileinput.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/fileinput.js

+12-7
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
' <param name="autoPlay" value="false" />\n' +
4545
' <param name="autoStart" value="false" />\n'+
4646
' <param name="quality" value="high" />\n',
47-
DEFAULT_PREVIEW = '<div class="file-preview-other" ' + STYLE_SETTING + '>\n' +
48-
' <h2><i class="glyphicon glyphicon-file"></i></h2>\n' +
47+
DEFAULT_PREVIEW = '<div class="file-preview-other">\n' +
48+
' <i class="glyphicon glyphicon-file"></i>\n' +
4949
' </div>';
5050

5151
var defaultFileActionSettings = {
@@ -184,8 +184,8 @@
184184
video: {width: "213px", height: "160px"},
185185
audio: {width: "213px", height: "80px"},
186186
flash: {width: "213px", height: "160px"},
187-
object: {width: "213px", height: "160px"},
188-
other: {width: "160px", height: "auto"}
187+
object: {width: "160px", height: "160px"},
188+
other: {width: "160px", height: "160px"}
189189
};
190190
var defaultFileTypeSettings = {
191191
image: function(vType, vName) {
@@ -508,13 +508,16 @@
508508
}
509509
return '';
510510
},
511-
renderFileFooter: function(caption, width, indicator) {
511+
renderFileFooter: function(caption, width) {
512512
var self = this, config = self.fileActionSettings,
513513
template = self.getLayoutTemplate('footer');
514514
if (self.isUploadable) {
515515
var footer = template.replace(/\{actions\}/g, self.renderFileActions(true, true, false, false, false));
516516
return footer.replace(/\{caption\}/g, caption).replace(/\{width\}/g, width)
517517
.replace(/\{indicator\}/g, config.indicatorNew).replace(/\{indicatorTitle\}/g, config.indicatorNewTitle);
518+
} else {
519+
return template.replace(/\{actions\}/g, '').replace(/\{caption\}/g, caption).replace(/\{width\}/g, width)
520+
.replace(/\{indicator\}/g, '').replace(/\{indicatorTitle\}/g, '');
518521
}
519522
return '';
520523
},
@@ -1083,14 +1086,16 @@
10831086
}
10841087
var data = vUrl.createObjectURL(file), $obj = $('#' + previewId),
10851088
config = self.previewSettings.other,
1086-
footer = self.renderFileFooter(file.name, config.width),
1089+
footer = self.isUploadable ?
1090+
self.renderFileFooter(file.name, config.width) :
1091+
self.renderFileFooter(file.name, config.width, false),
10871092
previewOtherTemplate = self.getPreviewTemplate('other'),
10881093
ind = previewId.slice(previewId.lastIndexOf('-') + 1),
10891094
frameClass = '';
10901095
if (arguments.length > 2) {
10911096
var $err = $(self.msgValidationError);
1092-
footer = '<i class="glyphicon glyphicon-exclamation-sign text-danger pull-right"></i>' + file.name;
10931097
frameClass = ' btn disabled';
1098+
footer += '<div class="file-other-error text-danger"><i class="glyphicon glyphicon-exclamation-sign"></i></div>';
10941099
}
10951100
self.$preview.append("\n" + previewOtherTemplate
10961101
.replace(/\{previewId\}/g, previewId)

js/fileinput.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)