浏览代码

Updated buttons display condition

Kartik Visweswaran 11 年之前
父节点
当前提交
ed208c9ee0
共有 9 个文件被更改,包括 16 次插入3 次删除
  1. 0 0
      CHANGE.md
  2. 0 0
      LICENSE.md
  3. 0 0
      bower.json
  4. 0 0
      composer.json
  5. 0 0
      css/fileinput.css
  6. 0 0
      css/fileinput.min.css
  7. 9 2
      examples/index.html
  8. 7 1
      js/fileinput.js
  9. 0 0
      js/fileinput.min.js

+ 0 - 0
CHANGE.md


+ 0 - 0
LICENSE.md


+ 0 - 0
bower.json


+ 0 - 0
composer.json


+ 0 - 0
css/fileinput.css


+ 0 - 0
css/fileinput.min.css


+ 9 - 2
examples/index.html

@@ -6,7 +6,7 @@
         <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
         <link href="../css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
-        <script src="../js/fileinput.js" type="text/javascript"></script>
+        <script src="../js/fileinput.min.js" type="text/javascript"></script>
     </head>
     <body>
         <div class="container">
@@ -19,7 +19,7 @@
                     <input id="file-2" type="file" class="file" readonly=true>
                 </div> 
                 <div class="form-group">
-                    <input id="file-1" type="file" class="file" multiple=true data-show-caption="false" data-browse-class="btn btn-primary btn-lg" data-preview-file-type="any">
+                    <input id="file-3" type="file" multiple=true>
                 </div>
                 <div class="form-group">
                     <button class="btn btn-primary">Submit</button>
@@ -28,4 +28,11 @@
             </form>
         </div>
     </body>
+	<script>
+	$("#file-3").fileinput({
+		showCaption: false,
+		browseClass: "btn btn-primary btn-lg",
+		fileType: "any"
+	});
+	</script>
 </html>

+ 7 - 1
js/fileinput.js

@@ -254,6 +254,9 @@
         },
         renderRemove: function() {
             var self = this, css = self.removeClass + ' fileinput-remove fileinput-remove-button', status = '';
+			if (!self.showRemove) {
+				return '';
+			}
             if (self.isDisabled) {
                 status = ' disabled ';
             }
@@ -261,6 +264,9 @@
         },
         renderUpload: function() {
             var self = this, content = '', status = '';
+			if (!self.showUpload) {
+				return '';
+			}
             if (self.isDisabled) {
                 status = ' disabled ';
             }
@@ -294,7 +300,7 @@
             var $this = $(this),
                 data = $this.data('fileinput'),
                 options = typeof option === 'object' && option;
-
+			
             if (!data) {
                 $this.data('fileinput', (data = new FileInput(this, $.extend({}, $.fn.fileinput.defaults, options, $(this).data()))));
             }

文件差异内容过多而无法显示
+ 0 - 0
js/fileinput.min.js


部分文件因为文件数量过多而无法显示