Răsfoiți Sursa

Merge branch '2.0' into gitee2

jqh 4 ani în urmă
părinte
comite
4061de62c6

+ 1 - 1
resources/views/form/markdown.blade.php

@@ -26,7 +26,7 @@
         ele.prototype.webkitMatchesSelector;
 </script>
 
-<script require="@markdown" init="{!! $selector !!}">
+<script require="@editor-md-form" init="{!! $selector !!}">
     editormd(id, {!! $options !!});
 
     Element.prototype.matches = Dcat.eMatches;

+ 3 - 0
resources/views/grid/displayer/extensions/name.blade.php

@@ -45,6 +45,9 @@
 @endif
 
 <style>
+    .badge {
+        max-height: 22px
+    }
     .hover-display {
         display:none;
     }

+ 2 - 2
src/Extend/ServiceProvider.php

@@ -343,8 +343,8 @@ abstract class ServiceProvider extends LaravelServiceProvider
     /**
      * 更新扩展.
      *
-     * @param $currentVersion
-     * @param $stopOnVersion
+     * @param string $currentVersion
+     * @param string $stopOnVersion
      *
      * @throws \Exception
      */

+ 7 - 13
src/Grid/Actions/QuickEdit.php

@@ -7,8 +7,6 @@ use Dcat\Admin\Grid\RowAction;
 
 class QuickEdit extends RowAction
 {
-    protected static $resolvedWindow;
-
     /**
      * @return array|null|string
      */
@@ -23,19 +21,15 @@ class QuickEdit extends RowAction
 
     public function render()
     {
-        if (! static::$resolvedWindow) {
-            static::$resolvedWindow = true;
-
-            [$width, $height] = $this->parent->option('dialog_form_area');
+        [$width, $height] = $this->parent->option('dialog_form_area');
 
-            $title = trans('admin.edit');
+        $title = trans('admin.edit');
 
-            Form::dialog($title)
-                ->click(".{$this->getElementClass()}")
-                ->dimensions($width, $height)
-                ->forceRefresh()
-                ->success('Dcat.reload()');
-        }
+        Form::dialog($title)
+            ->click(".{$this->getElementClass()}")
+            ->dimensions($width, $height)
+            ->forceRefresh()
+            ->success('Dcat.reload()');
 
         $this->setHtmlAttribute([
             'data-url' => "{$this->resource()}/{$this->getKey()}/edit",

+ 4 - 2
src/Grid/Column.php

@@ -528,6 +528,10 @@ class Column
         $i = 0;
 
         $data->transform(function ($row, $key) use (&$i) {
+            $this->setOriginalModel(static::$originalGridModels[$key]);
+
+            $this->originalModel['_index'] = $row['_index'] = $i;
+
             $row = $this->convertModelToArray($row);
 
             $i++;
@@ -535,8 +539,6 @@ class Column
                 $row['#'] = $i;
             }
 
-            $this->setOriginalModel(static::$originalGridModels[$key]);
-
             $this->original = Arr::get($this->originalModel, $this->name);
 
             $this->value = $value = $this->htmlEntityEncode($original = Arr::get($row, $this->name));

+ 1 - 1
src/Layout/Asset.php

@@ -148,7 +148,7 @@ class Asset
                 '@admin/dcat/extra/markdown.css',
             ],
         ],
-        '@markdown' => [
+        '@editor-md-form' => [
             'js' => [
                 '@admin/dcat/plugins/editor-md/lib/raphael.min.js',
                 '@admin/dcat/plugins/editor-md/editormd.min.js',