Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

drag & drop sortable file_list #603

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions helpers/cmb_Meta_Box_types.php
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ public function file_list() {
}

echo '</ul>';
echo '<script>
jQuery(document).ready(function($) {
$( "#', $this->_id( '_status' ) ,'" ).sortable({ cursor: "move" });
$( "#', $this->_id( '_status' ) ,'" ).disableSelection();
});
</script>';
}

public function file() {
Expand Down
2 changes: 1 addition & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ public static function save_field( $new_value, $field ) {
// }
// }
// } else
if ( ! empty( $new_value ) && $new_value != $old ) {
if ( ! empty( $new_value ) && $new_value !== $old ) {
self::$updated[] = $name;
return $field->update_data( $new_value );
} elseif ( empty( $new_value ) ) {
Expand Down
1 change: 1 addition & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ table.cmb_metabox .attach_list li {
table.cmb_metabox .attach_list li img {
float: left;
margin-right: 10px;
cursor: move;
}

/**
Expand Down
Loading