angular.module("RdmApp").controller("DashboardCtrl",["$scope","$rootScope","common","DTOptionsBuilder","DTColumnBuilder","$http","$q","ApiServer",function(t,e,o,a,i,r,n,l){t.editProfile=function(){$(".edit-modal").modal("show"),$(".modal-dialog").draggable({handle:".modal-header"})},t.getdashboard=function(){l.get("guru/dashboard",(function(t){e.dashboard=t.data}))},t.savedataEdit=function(){$(".edit-modal").modal("hide"),$.blockUI({}),l.post("guru/saveprofile",e.profile,(function(t){$.unblockUI({}),t.success?(e.getprofile(),Swal.fire({type:"success",title:"Berhasil",showConfirmButton:!1,html:"Data Berhasil Disimpan",timer:1e3})):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.message}).then((t=>{t.value&&$(".edit-modal").modal("show")}))}))},t.getdashboard(),t.browseimage=function(){$("#imageFile").click()},t.$on("pictureInsert",(function(t,o){e.profile.guru_foto=o}))}]),angular.module("RdmApp").directive("myDirective",["httpPostFactory",function(t){return{restrict:"A",scope:!0,link:function(e,o,a){o.bind("change",(function(){$.blockUI({});var a=new FormData;a.append("file",o[0].files[0]);var i=o[0].getAttribute("data-url");o[0].getAttribute("image-container");t(i,a,(function(t){$.unblockUI({}),t&&t.success?e.$emit("pictureInsert",t.data):Swal.fire({type:"error",title:"Gagal",showConfirmButton:!0,html:t.data})}))}))}}}]);