kartik-v / yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0
http://demos.krajee.com/markdown
Other
89 stars 41 forks source link

Make Save Button optional #4

Closed chris68 closed 10 years ago

chris68 commented 10 years ago

The save button is likely to be misinterpreted if you use the editor in a form (people think they will update/submit the form).

It would be helpful, to make it optional (via a parameter to the widget),

kartik-v commented 10 years ago

Preview and Save button display have properties showPreview and showSave respectively and are defaulted to true. You can pass these in your widget properties.

Resolved via commit 9384671. Thanks for reporting.

chris68 commented 10 years ago

@kartik-v

It does not work for me. As soon as I set it to false I get Cannot unset string offsets in


1. in /home/mailwitch/NetBeansProjects/pnauw/vendor/kartik-v/yii2-markdown/kartik/markdown/MarkdownEditor.php at line 564
559560561562563564565566567568569   

                ]
            ],
        ];

        if (!$this->showSave) {
            unset($this->footer[0]);
        }
        if (!$this->showPreview) {
            unset($this->footer[1]);
        }
    }
kartik-v commented 10 years ago

Typo to be corrected.

kartik-v commented 10 years ago

Resolved. Typo corrected in commit d5f6145. Thanks for reporting.

kartik-v commented 10 years ago

Will rename Save to Export - to be more correct. The variable showSave will be renamed to showExport

kartik-v commented 10 years ago

Changes done. Renamed instances of Save to Export via commit fba4522.